-
Notifications
You must be signed in to change notification settings - Fork 645
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] relatedTo variable type [Int] and [QueryArgument] conflict #5841
Comments
Yes, that's correct. This is because the If you know the field the relationship is used on, you can, however, use that field as the argument instead of using |
@andris-sevcenko ah ok that makes sense. Using the field as an argument works perfectly. Thanks for the help! |
Can we have an example maybe in the docs. I'm having a similar issue and can't find a good solution / explanation. query($id: [Int!], $entryID: [Int!]) {
entries(section: "items", relatedTo: $id, id: ["not", $entryID]) {
... |
Never mind... figured it out 🤦♂️ I've now got ... query($id: [Int!], $entryID: QueryArgument) {
entries(section: "items", relatedTo: $id, id: ["not", $entryID]) {
... |
@mediabeastnz glad you figured it out! I agree that there are some murky things we should clear up in GraphQL. I'll see how soon we can fill those gaps. |
query($id: ID!, $entryID: QueryArgument) { well like this also works for me |
Description
Querying an entry by ID requires that the variable type be [QueryArgument]. However related entries require the variable type to be [Int]
Query variable
{ "id": 173 }
Query [QueryArgument]
Error [QueryArgument]
Query [Int]
Error [Int]
Additional info
The text was updated successfully, but these errors were encountered: