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

InvalidSyntax error on executing this project #10

Open
KushagraBindal opened this issue May 12, 2021 · 2 comments
Open

InvalidSyntax error on executing this project #10

KushagraBindal opened this issue May 12, 2021 · 2 comments

Comments

@KushagraBindal
Copy link

While trying to execute the project using below query

{
book(id: "123") {
title
authors
publisher
}
}

I am getting below error.

{
"data": null,
"errors": [
{
"message": "Invalid Syntax",
"locations": [
{
"line": 1,
"column": 1,
"sourceName": null
}
],
"errorType": "InvalidSyntax",
"path": null,
"extensions": null
}
],
"dataPresent": false,
"extensions": null
}

On server side I am getting below error

2021-05-12 18:11:10.346 WARN 16964 --- [o-auto-1-exec-5] graphql.GraphQL : Query failed to parse : '{"operationName":null,"variables":{},"query":"{\n book(id: "123") {\n title\n authors\n publisher\n }\n}\n"}'

Please help in understanding the root cause of this problem and how to fix the same.

@KushagraBindal
Copy link
Author

KushagraBindal commented May 12, 2021

@MovingToWeb can you please help here... Just to highlight that I am using java 1.8 in my case and this shouldn't be the problem as my application compiled and code is in running state.

I have observed one more thing, when I am running through POSTMAN(Chrome/Window) it is working with contentType application/json but when trying with Postman as Graphql it is throwing above error. I am getting in playground as well.

@midhunhk
Copy link

Make sure to select the following in the body of the Request in Postman.

Type: Raw, and select "text" from the dropdown

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

2 participants