charlypoly / graphql-to-json-schema

GraphQL Schema to JSON Schema
MIT License
202 stars 25 forks source link

Unexpected token P in JSON at position 1 #40

Closed SlashKirill closed 3 years ago

SlashKirill commented 3 years ago

Hi,

originally coming from this issue: Unexpected token P in JSON at position 1 for spectaql project.

Opened by repo maintainer request.

undefined:1
[PRIMARY_KEY_ASC]
 ^

SyntaxError: Unexpected token P in JSON at position 1
    at JSON.parse (<anonymous>:null:null)
    at Object.resolveDefaultValue (/path/to/spectaql/node_modules/graphql-2-json-schema/dist/lib/reducer.js:51:16)
    at introspectionFieldReducer (/path/to/spectaql/node_modules/graphql-2-json-schema/dist/lib/reducer.js:38:46)
    at arrayReduce (/path/to/spectaql/node_modules/lodash/lodash.js:697:21)
    at Function.reduce (/path/to/spectaql/node_modules/lodash/lodash.js:9749:14)
    at introspectionFieldReducer (/path/to/spectaql/node_modules/graphql-2-json-schema/dist/lib/reducer.js:26:46)
    at arrayReduce (/path/to/spectaql/node_modules/lodash/lodash.js:697:21)
    at Function.reduce (/path/to/spectaql/node_modules/lodash/lodash.js:9749:14)
    at /path/to/spectaql/node_modules/graphql-2-json-schema/dist/lib/reducer.js:59:34
    at arrayReduce (/path/to/spectaql/node_modules/lodash/lodash.js:697:21)
    at Function.reduce (/path/to/spectaql/node_modules/lodash/lodash.js:9749:14)
    at Object.fromIntrospectionQuery (/path/to/spectaql/node_modules/graphql-2-json-schema/dist/lib/fromIntrospectionQuery.js:30:30)
    at jsonSchemaFromIntrospectionResponse (/path/to/spectaql/app/spectaql/graphql-loaders.js:88:20)
    at module.exports (/path/to/spectaql/app/spectaql/index.js:108:22)
    at loadData (/path/to/spectaql/app/index.js:169:74)
    at module.exports (/path/to/spectaql/app/index.js:173:80)
    at Object.<anonymous> (/path/to/spectaql/bin/spectaql.js:70:1)
    at Module._compile (internal/modules/cjs/loader.js:1076:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:941:32)
    at Function.Module._load (internal/modules/cjs/loader.js:782:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47