get-graphql-schema icon indicating copy to clipboard operation
get-graphql-schema copied to clipboard

Error with JSON

Open JohnieXu opened this issue 6 years ago • 2 comments
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

JohnieXu avatar Apr 14 '19 15:04 JohnieXu

Same problem? Any answers?

warcayac avatar Sep 19 '21 15:09 warcayac

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.

odigity avatar Mar 15 '22 19:03 odigity