-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Error when querying via GraphQL #300
Comments
Thanks for the great plugin first of all! Plugin version: 2.3.0 |
Can either of you let me know what you're querying with, just so I can check things on my end? |
@engram-design Getting the same error for one of my projects as well. Steps to reproduce
Error output
Additional info
Screenshots of the actual block structure, GQL query and output |
I had this problem too. Found this in a similar issue with Neo. It works!
|
@sgtpenguin This works for me when querying directly on Craft's GraphQL endpoint, but |
I am having the same issue as @mattstein. This is due to a change in Craft 3.3.3. - $devMode = Craft::$app->getConfig()->getGeneral()->devMode;
- $schemaDef = $gqlService->getSchemaDef($schema, $devMode);
+ $schemaDef = $gqlService->getSchemaDef($schema, StringHelper::contains($query, '__schema')); You can see that Craft previously returned the full schema when the site was in I do not know what the proper solution is here. Any thoughts? |
I can't figure out how to modify What's interesting is that this doesn't seem to be a problem for Matrix blocks, but only for Super Table blocks (and presumably any third-party unions?). |
A fix for this is upstream, but needs attention on the plugin side to implement: craftcms/cms#5067 |
I've read through this issue and the Craft issue a couple times but can't quite tell. Is this something we're waiting on a fix from Craft or does this plugin need updating to fix this? Gatsby doesn't pull in |
@wfendler I believe each plugin author has to implement the fix, including Josh + Super Table, and I'm still patching Craft as of 3.3.11 to get around this. diff --git a/src/controllers/GraphqlController.php b/src/controllers/GraphqlController.php
index ad7641af80..4666ed4a71 100644
--- a/src/controllers/GraphqlController.php
+++ b/src/controllers/GraphqlController.php
@@ -140,7 +140,7 @@ class GraphqlController extends Controller
}
try {
- $schemaDef = $gqlService->getSchemaDef($schema, StringHelper::contains($query, '__schema'));
+ $schemaDef = $gqlService->getSchemaDef($schema, true);
$result = $gqlService->executeQuery($schemaDef, $query, $variables, $operationName);
} catch (\Throwable $e) {
Craft::$app->getErrorHandler()->logException($e); From what I can tell, this line needs to |
Should be fixed in 2.3.1 |
Description
Getting an error when trying to query a SuperTable field. I have deleted and recreated the field multiple times always resulting in the same error. It looks like GQL support is rather new (#295) so perhaps this is a bug? Thanks for all the efforts on a great plugin btw.
Steps to reproduce
Additional info
Error Output
The text was updated successfully, but these errors were encountered: