Closed zjr closed 1 year ago
Is there any error similar to this in your Craft logs (/storage/logs
) that might pinpoint the file/line this error occurs on?
I found this in the web log, though I'm not sure how helpful it could be.
2022-09-24 13:30:47 [web.ERROR] [GraphQL\Error\Error] Cannot query field "node" on type "Query".
GraphQL (2:3)
1: query NODE_footerSecondary_Node {
2: node(id: $id, siteId: $siteId, status: null) {
^
3: remoteTypeName: __typename
{"memory":12750032,"exception":"[object] (GraphQL\\Error\\Error(code: 0): Cannot query field \"node\" on type \"Query\". at /var/www/html/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php:57)"}
2022-09-24 13:30:47 [web.ERROR] [GraphQL\Error\Error] Variable "$id" is not defined by operation "NODE_footerSecondary_Node".
GraphQL (2:12)
1: query NODE_footerSecondary_Node {
2: node(id: $id, siteId: $siteId, status: null) {
^
3: remoteTypeName: __typename
GraphQL (1:1)
1: query NODE_footerSecondary_Node {
^
2: node(id: $id, siteId: $siteId, status: null) {
{"memory":12750440,"exception":"[object] (GraphQL\\Error\\Error(code: 0): Variable \"$id\" is not defined by operation \"NODE_footerSecondary_Node\". at /var/www/html/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php:40)"}
2022-09-24 13:30:47 [web.ERROR] [GraphQL\Error\Error] Variable "$siteId" is not defined by operation "NODE_footerSecondary_Node".
GraphQL (2:25)
1: query NODE_footerSecondary_Node {
2: node(id: $id, siteId: $siteId, status: null) {
^
3: remoteTypeName: __typename
GraphQL (1:1)
1: query NODE_footerSecondary_Node {
^
2: node(id: $id, siteId: $siteId, status: null) {
{"memory":12750848,"exception":"[object] (GraphQL\\Error\\Error(code: 0): Variable \"$siteId\" is not defined by operation \"NODE_footerSecondary_Node\". at /var/www/html/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php:40)"}
2022-09-24 13:30:47 [web.ERROR] [GraphQL\Error\Error] Cannot query field "nodes" on type "Query".
GraphQL (10:3)
9: query LIST_footerSecondary_Node {
10: nodes(limit: $limit, offset: $offset, site: "default") {
^
11: remoteTypeName: __typename
{"memory":12751256,"exception":"[object] (GraphQL\\Error\\Error(code: 0): Cannot query field \"nodes\" on type \"Query\". at /var/www/html/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php:57)"}
2022-09-24 13:30:47 [web.ERROR] [GraphQL\Error\Error] Variable "$limit" is not defined by operation "LIST_footerSecondary_Node".
GraphQL (10:16)
9: query LIST_footerSecondary_Node {
10: nodes(limit: $limit, offset: $offset, site: "default") {
^
11: remoteTypeName: __typename
GraphQL (9:1)
8:
9: query LIST_footerSecondary_Node {
^
10: nodes(limit: $limit, offset: $offset, site: "default") {
{"memory":12751664,"exception":"[object] (GraphQL\\Error\\Error(code: 0): Variable \"$limit\" is not defined by operation \"LIST_footerSecondary_Node\". at /var/www/html/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php:40)"}
2022-09-24 13:30:47 [web.ERROR] [GraphQL\Error\Error] Variable "$offset" is not defined by operation "LIST_footerSecondary_Node".
GraphQL (10:32)
9: query LIST_footerSecondary_Node {
10: nodes(limit: $limit, offset: $offset, site: "default") {
^
11: remoteTypeName: __typename
GraphQL (9:1)
8:
9: query LIST_footerSecondary_Node {
^
10: nodes(limit: $limit, offset: $offset, site: "default") {
{"memory":12752072,"exception":"[object] (GraphQL\\Error\\Error(code: 0): Variable \"$offset\" is not defined by operation \"LIST_footerSecondary_Node\". at /var/www/html/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php:40)"}
So the 2022-09-24 13:30:47 [web.ERROR] [GraphQL\Error\Error] Cannot query field "node" on type "Query".
line refers to queries using:
node(id: $id, siteId: $siteId, status: null) {
...
}
Instead of
navigationNode(id: $id, siteId: $siteId, status: null) {
...
}
Which is covered in the Craft 4 upgrade docs. Sounds like that might not have been changed?
https://verbb.io/craft-plugins/navigation/docs/get-started/upgrading-from-v1#queries
I'll look further later, but I installed Craft 4 & this version of Navigation less than a week ago, so an upgrading problem doesn't seem right?
Ah, my mistake! I forgot to adjust these names specifically for the Gatsby integration. Should be fixed for the next release. To get the fix early, change your verbb/navigation
requirement in composer.json
to:
"require": {
"verbb/navigation": "dev-craft-4 as 2.0.5",
"...": "..."
}
Then run composer update
.
Fixed in 2.0.6
@engram-design thank you!
Describe the bug
When any navigation is enabled in my schema I get an error in
gatsby develop
fromgatsby-source-craft
.Looks like the following:
I checked it in the debugger but I don't really know what I'm looking at. I did see this odd query though:
I say odd only because I don't know where
footerSecondary_Node
is coming from.Would love to help with a minimal test case but am unfortunately not in a good spot to make one right now, sorry..
Steps to reproduce
gatsby-source-craft
.gatsby develop
.Craft CMS version
4.2.5.1
Plugin version
2.0.5
Multi-site?
No
Additional context
gatsby-source-craft v3.0.0 (latest at time of writing)