get-graphql-schema
get-graphql-schema copied to clipboard
Does not support invalid SSL certificates
Needs to have an option to enable this for local dev purposes
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0'
{ FetchError: request to https://localhost:3045/dev/graphql failed, reason: unable to verify the first certificate
at ClientRequest.<anonymous> (/Users/t.gravity/.nvm/versions/node/v8.9.1/lib/node_modules/get-graphql-schema/node_modules/node-fetch/index.js:133:11)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
name: 'FetchError',
"get-schema:dev": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 graphql get-schema dev",
Using the @MartinDawson idea, we can use the same strategy on CLI
npm install -g get-graphql-schema
NODE_TLS_REJECT_UNAUTHORIZED=0 get-graphql-schema GRAPHQL_ENDPOINT > schema.graphql