Closed edgarsn closed 3 years ago
At first I thought it's a json parse error, but actually I think it's a graphql parse error.
Are you able to debug the exact HTTP request being sent? They might help pinpoint the problem. Or debug server side where this is thrown exactly would also help (enabling debug should give a stacktrace)
useGETForHashedQueries
This might well be related to our request parsing .. in 7.x this was done hand-crafted in the library, for the upcoming 8.x release I switched to using https://github.com/laragraph/utils which I noticed does a few things differently. So maybe it better supports this.
You can try https://github.com/rebing/graphql-laravel/releases/tag/8.0.0-rc2 but it requires some effort as it contains quite some breaking changes.
Nevertheless, knowing how the request looks exactly would help writing a testcase to cover this. I personally don't do frontend stuff, so I can't help with this library.
@illambo is the original author, maybe he has some idea here
Hello, I would need at least the trace of the request to better understand the situation and replicate a possible test on the matter.
Hello!
{useGETForHashedQueries: false}
:
Payload:
{
"operationName": null,
"variables": [],
"extensions": {
"persistedQuery": {
"version": 1,
"sha256Hash": "d7b7fc27911575ba2b55aa3063148d7979668fb35a19a7e3c2e29c0044c8301e"
}
}
}
{useGETForHashedQueries: true}
:
Request Path:
/graphql?extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%2244e3d137628ea65df1c0103431c93d55782571d9e1a53cf9b597fb007d4b6f86%22%7D%7D&variables=%7B%7D
Let me know if you need something more.
I suspected correctly in https://github.com/rebing/graphql-laravel/issues/780#issuecomment-844714415 : the handling of the GET request in master/8.x-dev branch already works correctly because we switched to https://github.com/laragraph/utils for handling the specifics of HTTP requests:
This can't be backported to 7.x as it brings breaking changes (see https://github.com/rebing/graphql-laravel/pull/739 for details) and is one of the very reasons we're bumping the major version with the next release.
I'm already running https://github.com/rebing/graphql-laravel/releases/tag/8.0.0-rc2 in production so it's "safe" from that POV, besides the adaptions it requires due to breaking changes.
However: the work for 8.0 is not yet done and more breaking changes might come. If you're not interested in handling further breaking changes, I suggest to wait.
Thanks for your report!
TL;DR: closing, as it already works correctly in master
Sorry if I was not helpful in time. Great job!
Versions:
Description:
I was trying to implement APQ in my site. Everythink works well until I change:
to
According to Apollo documentation, it should work.
In this case response is
GraphQL error: Syntax Error: Unexpected <EOF>
. Full response:I can confirm, that I don't use
TrimStrings
middleware and runphp artisan cache:clear
before setting{useGETForHashedQueries: true}
Steps To Reproduce:
I think I described the steps enough in description :)
Let me know if I somehow can help you to debug this issue.