get-graphql-schema
get-graphql-schema copied to clipboard
FetchError: invalid json response body at http://localhost:4000/graphql reason: Unexpected token < in JSON at position 0
I'm trying a
$ get-graphql-schema http://localhost:4000/graphql > ./schema.graphql
And complain for this:
FetchError: invalid json response body at http://localhost:4000/graphql reason: Unexpected token < in JSON at position 0
at /Users/romenigld/.asdf/installs/nodejs/12.13.1/.npm/lib/node_modules/get-graphql-schema/node_modules/node-fetch/lib/index.js:272:32
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
message: 'invalid json response body at http://localhost:4000/graphql reason: Unexpected token < in JSON at position 0',
type: 'invalid-json'
}
I believe that you are getting an HTML response. Check the actual response body.
I have the same problem My response is in JSON .
See my comment here: https://github.com/prisma-labs/get-graphql-schema/issues/29#issuecomment-1068410112