You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

fetch-graphql-schema

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-graphql-schema

fetch GraphQL schema via introspection query


Version published
Weekly downloads
941
decreased by-10.89%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

fetch-graphql-schema

NPM version Build Status Test coverage Dependency Status

fetch GraphQL schema via introspection query

Install

$ npm install fetch-graphql-schema

Usage

const fetchSchema = require('fetch-graphql-schema');

fetchSchema('http://localhost:8080/graphql')
  .then(schemaJSON => {
    /**
     * {
     *   "data": {
     *     "__schema": {
     *       "queryType": {
     *         "name": "Query"
     *          ....
     */
  });

fetchSchema('http://localhost:8080/graphql', { readable: true })
  .then(clientSchema => {
    /**
     * type User implements Node {
     *   id: ID!
     *   name: String!
     * }
     */
  });
//=>

API

fetchGraphqlSchema(url, [options])

url

Required Type: string

URL of GraphQL server.

options
readable

Type: boolean Default: false

resolve .graphql instead of .json.

CLI

Usage
$ fetch-graphql-schema <schemaUrl>
Options
-o, --output    Specify an output filename.
-r, --readable  Resolve .graphql instead of .json.
Examples
$ fetch-graphql-schema http://api.server/graphql -o schema.json
$ fetch-graphql-schema http://api.server/graphql -o schema.graphql -r

License

MIT © C.T. Lin

Keywords

FAQs

Package last updated on 22 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc