Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-fetch-schema

Package Overview
Dependencies
Maintainers
6
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-fetch-schema

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

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
102
increased by13.33%
Maintainers
6
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 10 Jan 2019

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc