-
Notifications
You must be signed in to change notification settings - Fork 641
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 mutations throw internal server error via REST, but succeed via GraphiQL in CraftCMS 3.7.x #9842
Comments
Looks like this might be happening due to a disabled site. Just fixed that for the next release. To get the fix early, change your |
Edit: For reference, here's what our sites look like: |
Oh, this looks like an issue with craft-scout. Will try updating that plugin... |
Craft 3.7.14 is out now with that initial fix. |
Note: Updating craft-scout to latest 2.5.0 resolved the issue mentioned previously, but attempting a mutation when a disabled site exists still throws an error in Craft 3.7.14. See: #9948 |
Description
Sending a GraphQL mutation within GraphiQL succeeds, but when I submit the exact same mutation using the same Schema (with full mutation permissions) via a POST, I get an internal server error.
When sending the mutation via POST it throws the following error in web.log:
Network trace shows the same payload (except obviously some special headers for being sent because GraphiQL is in admin):
The post succeeding in GraphiQL
And the response from the server confirming the mutation succeeded via GraphiQL:
The POST with the same mutation that is throwing the error:
And the response with the internal server error:
This didn't happen in 3.5.19, but 3.5 also doesn't have the ability to post to nested Super Table > Matrix fields, which we also need to do here (although this is just a Matrix field).
Note: The POST is using a Bearer token that is assigned to a schema with all boxes checked on the GraphQL schema page. The GraphiQL mutation is also run with the same Schema selected (instead of the default "full" schema GraphiQL uses), to rule out a schema permission issue:
Note: I got a different internal server error when attempting to run this mutation via a POST with an older version of the element-api plugin, but that error went away after upgrading that plugin to the latest version.
Note: This is the same CraftCMS instance as was running for for CraftCMS Support ticket # 15025, which should have a zip of the config and database in the ticket, if needed, though that hadn't yet bet upgraded to Craft 3.7.x.
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: