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

graphql error: Unexpected token < in JSON at position 0 #20

Closed
deemaxx opened this issue Apr 9, 2017 · 4 comments
Closed

graphql error: Unexpected token < in JSON at position 0 #20

deemaxx opened this issue Apr 9, 2017 · 4 comments

Comments

@deemaxx
Copy link

deemaxx commented Apr 9, 2017

I am getting an error despite the activated plugin. The console reports a parse error which points to the usage of a PHP7 null coalescing operator (??):
Parse error</b>: syntax error, unexpected '?' in <b>/wordpress/web/app/plugins/graphql-wp/Type/Definition/WPPost.php

I am running a Docker container on PHP5.6. The graphql-wp repo's composer.json file requires php>=5.6. So, maybe it requires now PHP7. But, I am confused because no one has mentioned this anywhere.

@tim-field
Copy link
Owner

Whoops yeah, you are right. Is it possible for you to switch to 7? I'll update the composer.json now. I suspect there might be other issues as I've been developing this in 7 for a while now.

tim-field added a commit that referenced this issue Apr 11, 2017
@deemaxx
Copy link
Author

deemaxx commented Apr 14, 2017

Yes, I updated PHP to version 7.1 and it is now working fine. I was just confused at first. Thanks.

@tim-field
Copy link
Owner

Glad to hear and thanks for reporting. Sorry for not having composer up to date.

@chrisfullman
Copy link

I resolved this issue by flushing the rewrite rules (Settings > Permalinks > Save). Turns out that the endpoint was just getting a 404 page until I flushed the rules.

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