graphql-fetch-schema
Fetch a GraphQL schema from a server and write it to file
Last updated 2 years ago by paul_lecam .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install graphql-fetch-schema 
SYNC missed versions from official npm registry.

graphql-fetch-schema

Fetch a GraphQL schema from a server and write it to file

Installation

npm install graphql-fetch-schema

CLI Usage

graphql-fetch-schema <url> [options]

Options

-h, --help                output usage information
-V, --version             output the version number
-c, --cookie              pass additional Cookie header
-g, --graphql             write schema.graphql file
-j, --json                write schema.json file
-o, --output <directory>  write to specified directory

API usage

import fetchSchema from 'graphql-fetch-schema'

fetchSchema('https://api.myserver.com/graphql', {
  json: true,
  graphql: false,
  outputPath: '../schema',
  cookie: 'cookiename=foo;',
  headers: {
    Authorization: 'Bearer token'
  }
}).then(
  () => {
    console.log('Schema successfully written')
  },
  err => {
    console.error(err)
  },
)

License

MIT

Current Tags

  • 1.1.0                                ...           latest (2 years ago)

13 Versions

  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.8.0                                ...           3 years ago
  • 0.7.2                                ...           3 years ago
  • 0.7.1                                ...           3 years ago
  • 0.7.0                                ...           3 years ago
  • 0.6.1                                ...           3 years ago
  • 0.6.0                                ...           3 years ago
  • 0.5.0                                ...           3 years ago
  • 0.4.0                                ...           4 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Downloads
Today 0
This Week 1
This Month 3
Last Day 0
Last Week 0
Last Month 2
Dependencies (5)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |