@shopify/graphql-js-schema-fetch
v1.1.0
Published
A simple command line tool for fetching the JSON representation of the GraphQL schema from a live server
Keywords
Readme
graphql-js-schema-fetch
It fetches the JSON representation of the GraphQL schema from a live server
Table Of Contents
Installation
$ npm install @shopify/graphql-js-schemaExamples
To fetch the json representation of the graphql schema from a live server that implements the GraphQL (and optionally the Relay) spec, run:
graphql-js-schema-fetch --url https://www.my-server.com/apiIf your server requires additional credentials or headers, use the --header
option:
graphql-js-schema-fetch --url https://www.my-server.com/api --header "Authorization: Basic abc123" --header "X-API-Version: 1.1"If your server uses something other than the POST method for its API, use the
--method option:
graphql-js-schema-fetch --url https://www.my-server.com/api --method GETAPI
const instance = graphqlJsSchemaFetch(url, method, [headers]);
Params you can pass graphqlJsSchemaFetch:
url- The url where your GraphQL API residesmethod- The HTTP method to use while making the requestheaders- A hash representing the key value pairs of headers to pass tonode-fetch
License
MIT, see LICENSE.md for details.

