Replies: 1 comment
-
To get the "ArticleFilter" type in the variable when using this Go package, you can specify it by using a named Go type. If your query struct looks like this (roughly): var query struct {
ArticleCollection struct {
Items []struct{
Slug string
}
} `graphql:"articleCollection(where: {OR: $ids})"`
} Then you can define a type ArticleFilter map[string]map[string]string
variables := map[string]interface{}{
"ids": []ArticleFilter{
{"sys": map[string]string{"id": "123"}},
{"sys": map[string]string{"id": "456"}},
{"sys": map[string]string{"id": "789"}},
},
} Since the variable "ids" has type |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am trying to replicate this query:
query ($ids: [ArticleFilter]) { articleCollection( where: { OR: $ids } ) { items { slug } } }
Query Variables:
[ { "sys": { "id": "123" } }, { "sys": { "id": "456" } }, { "sys": { "id": "789" } } ]
I am unsure how to get the query type of ArticleFilter required by the endpoint I am using.
Beta Was this translation helpful? Give feedback.
All reactions