(node:2919) UnhandledPromiseRejectionWarning: ReferenceError: query is not defined
at file:///Users/romanfrolow/personal_projects/fetch-graphql-schema-custom/index.mjs:22:13
at <anonymous>
(node:2919) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2919) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
{ FetchError: invalid json response body at http://127.0.0.1:8080/graphql2 reason: Unexpected end of JSON input
at /Users/romanfrolow/personal_projects/fetch-graphql-schema-custom/node_modules/node-fetch/lib/index.js:254:32
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:118:7)
message: 'invalid json response body at http://127.0.0.1:8080/graphql2 reason: Unexpected end of JSON input',
type: 'invalid-json' }
for example this returns error:
for code:
instead of
with the version using
try..catch
https://github.com/rofrol/fetch-graphql-schema-custom