markhuot / craftql

A drop-in GraphQL server for Craft CMS
Other
319 stars 53 forks source link

GraphiQL - "Unable to verify your data submission." #215

Open phantomramen opened 5 years ago

phantomramen commented 5 years ago

I can't seem to get any feedback or documentation on GraphiQL. I have had it running before on older versions of Craft in the same environment.

When I load it up the Query result section reads: { "error": "Unable to verify your data submission." }

And the Document Explorer reads: No schema available.

The browser console is giving the error : POST http://example.com/admin/craftql/browse/example.com/example.com/api 400 (Bad Request)

That url looks a bit fishy aye 🤔

I can run the example hello world curl command fine.

Homestead - 8.0.1 PHP - 7.1.26 CraftCMS Solo - 3.1.5 CraftQL - 1.3.0

pauloelias commented 5 years ago

@dannyryanuk have you set up your API token and given that user token the appropriate permissions to query or mutate data?

I received this exact error when trying to run a query with a user that was not set up with an API token.

markhuot commented 5 years ago

This also could be coming from your settings. In the HTML of the /admin/craftql/browse page is the following JS,

return fetch('$siteUrl/$uri', {

There, $siteUrl comes from the default Site URL set in the craft config and $uri comes from the CraftQL settings.

Can you let me know what (and how) your site URL is being set?

cmmize commented 5 years ago

So I'm having the same issue as @dannyryanuk. I have set up the api token as @pauloelias has suggested and getting the same errors{ "error": "Unable to verify your data submission." }. The base url is set to $DEFAULT_SITE_URL. This is a local install as I am in the development phase of project.

Query: { entries(section: "brand") { title } }

Results: { "error": "Unable to verify your data submission." }

Console error: :451 POST http://site-domain/admin/craftql/site-domain/api 400 (Bad Request) browse?query={ entries(section%3A "brand") { title } }

System:

PHP version | 7.2.8 Darwin 18.6.0 MySQL 5.7.23 GD 7.2.8 Craft Solo 3.1.29

CraftQL | 1.3.2

Any help would be greatly appreciated.

CraftQL - PRA Health Sciences Brand Guide 2019-07-03 17-17-32

sunscreem commented 4 years ago

Same issue here.

Works fine in production (linux).

PHP version 7.3.4 MySQL version 5.7.25 Craft Version 3.3.7

Running on laravel homestead on windows.