You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to query for entries where a craft-linkfield field is pointing to a particular destination.
More specifically, I want to find entries where the field is set to the "site" type, and points to a particular site ID.
Is this possible?
In the GQL explorer I see that there's an argument named after my link field (linkField for this example), and that it has the type [QueryArgument]. I can see QueryArgument mentioned a lot it Craft's docs but can't for the life of me find an actual explanation of what it is and how to use it. There's the Craft documentation page for GraphQL which mentions it as the type of a ton of different arguments but doesn't explain what it is, and then there's an API doc page for the class itself but that doesn't give any usage information either.
In searches I came across this comment, which suggests an array of QueryArgument can be things like ["not", 1, 2, 3], which gives some clues. I suspect it's documented elsewhere in a non-GQL context, but I haven't found it yet.
But regardless, no matter what I try to enter, whether strings or arrays of strings/numbers/booleans, I get this error:
The query for the field linkField refers to an unknown field '0'.
That happens in vendor/sebastianlenz/craft-utils/src/foreignField/ForeignField.php on line 318 (craft-utils is at version 3.0.3). Looking at that file, it seems it expects an associative array, but GQL does not let me pass an object here. Whether I pass a plain string or an array of strings/numbers/booleans, it arrives at this function as a number-indexed array. The code, meanwhile, expects the keys of the array to be field names.
The text was updated successfully, but these errors were encountered:
I'm using GQL.
I'd like to query for entries where a craft-linkfield field is pointing to a particular destination.
More specifically, I want to find entries where the field is set to the "site" type, and points to a particular site ID.
Is this possible?
In the GQL explorer I see that there's an argument named after my link field (
linkField
for this example), and that it has the type[QueryArgument]
. I can seeQueryArgument
mentioned a lot it Craft's docs but can't for the life of me find an actual explanation of what it is and how to use it. There's the Craft documentation page for GraphQL which mentions it as the type of a ton of different arguments but doesn't explain what it is, and then there's an API doc page for the class itself but that doesn't give any usage information either.In searches I came across this comment, which suggests an array of QueryArgument can be things like
["not", 1, 2, 3]
, which gives some clues. I suspect it's documented elsewhere in a non-GQL context, but I haven't found it yet.But regardless, no matter what I try to enter, whether strings or arrays of strings/numbers/booleans, I get this error:
That happens in
vendor/sebastianlenz/craft-utils/src/foreignField/ForeignField.php
on line 318 (craft-utils is at version 3.0.3). Looking at that file, it seems it expects an associative array, but GQL does not let me pass an object here. Whether I pass a plain string or an array of strings/numbers/booleans, it arrives at this function as a number-indexed array. The code, meanwhile, expects the keys of the array to be field names.The text was updated successfully, but these errors were encountered: