Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Error GraphQL request (1:2) Expected Name, found String \"query\" #12

Open
jeffgardnerdev opened this issue Oct 12, 2017 · 2 comments

Comments

@jeffgardnerdev
Copy link

I'm getting this error when running the following command:
get-graphql-schema -h Authorization=$AUTH_TOKEN https://my.graphql.endpoint.com > schema.graphql

Here is the full error output:

Error: [
  {
    "message": "Syntax Error GraphQL request (1:2) Expected Name, found String \"query\"\n\n1: {\"query\":\"\\n  query IntrospectionQuery {\\n    __schema {\\n      queryType { name }\\n      mutationType { name }\\n      subscriptionType { name }\\n      types {\\n        ...FullType\\n      }\\n      directives {\\n        name\\n        description\\n        locations\\n        args {\\n          ...InputValue\\n        }\\n      }\\n    }\\n  }\\n\\n  fragment FullType on __Type {\\n    kind\\n    name\\n    description\\n    fields(includeDeprecated: true) {\\n      name\\n      description\\n      args {\\n        ...InputValue\\n      }\\n      type {\\n        ...TypeRef\\n      }\\n      isDeprecated\\n      deprecationReason\\n    }\\n    inputFields {\\n      ...InputValue\\n    }\\n    interfaces {\\n      ...TypeRef\\n    }\\n    enumValues(includeDeprecated: true) {\\n      name\\n      description\\n      isDeprecated\\n      deprecationReason\\n    }\\n    possibleTypes {\\n      ...TypeRef\\n    }\\n  }\\n\\n  fragment InputValue on __InputValue {\\n    name\\n    description\\n    type { ...TypeRef }\\n    defaultValue\\n  }\\n\\n  fragment TypeRef on __Type {\\n    kind\\n    name\\n    ofType {\\n      kind\\n      name\\n      ofType {\\n        kind\\n        name\\n        ofType {\\n          kind\\n          name\\n          ofType {\\n            kind\\n            name\\n            ofType {\\n              kind\\n              name\\n              ofType {\\n                kind\\n                name\\n                ofType {\\n                  kind\\n                  name\\n                }\\n              }\\n            }\\n          }\\n        }\\n      }\\n    }\\n  }\\n\"}\n    ^\n",
    "locations": [
      {
        "line": 1,
        "column": 2
      }
    ]
  }
]
    
at /node_modules/get-graphql-schema/dist/index.js:83:31
at step (/node_modules/get-graphql-schema/dist/index.js:33:23)
at Object.next (/node_modules/get-graphql-schema/dist/index.js:14:53)
at fulfilled (/node_modules/get-graphql-schema/dist/index.js:5:58)
at process._tickCallback (internal/process/next_tick.js:109:7)

With Postman, requests with GraphQL syntax get a successful response, but when trying JSON syntax ({ "query": "...", "variables": null, "operationName": null }) it gives the same error as above.

@nkarre
Copy link

nkarre commented Jul 23, 2018

You got the solution ?

@usmcamp0811
Copy link

usmcamp0811 commented Mar 12, 2020

Any luck?
I've got the same problem now.. think it might have arisen when I began using InputObjects in Graphene. I need to roll back to before I implemented them to test this hypothesis though.

EDIT: I think I found the problem. It looks like it has to do with nested InputObjects.

EDIT2: Nope it looks more like it has to do with graphene.DataTime(default_value=maya.now().datetime()) in my graphene.InputObjectType.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants