get-graphql-schema
get-graphql-schema copied to clipboard
Error with JSON
trafficstars
error like this
{ FetchError: invalid json response body at http://localhost:18000/graphiql reason: Unexpected end of JSON input
at /Users/johniexu/.nvm/versions/node/v10.13.0/lib/node_modules/get-graphql-schema/node_modules/node-fetch/lib/index.js:241:32
at process._tickCallback (internal/process/next_tick.js:68:7)
message:
'invalid json response body at http://localhost:18000/graphiql reason: Unexpected end of JSON input',
type: 'invalid-json' }
graphiql server created by postgraphifle, when i run get-graphql-schema http://localhost:18000/graphiql > schema.graphql, I got error
Same problem? Any answers?
Would be nice if I could actually see the JSON that it's choking on. Would be nice if there was a debug or verbose flag for that.
BTW - In my case the error was caused by the CSRF protection in Django as explained here, but it would have been easier to determine the problem if I could see the HTML that get-graphql-schema was attempting to parse as JSON.