Closed piccione99 closed 1 month ago
As you can see in the error detail:
{
"errors": [
{
"message": "Cannot query field \"omitempty\" on type \"Event\".",
"locations": [{ "line": 1, "column": 95 }],
"extensions": { "code": "GRAPHQL_VALIDATION_FAILED" }
},
{
"message": "Cannot query field \"omitempty\" on type \"Event\".",
"locations": [{ "line": 1, "column": 112 }],
"extensions": { "code": "GRAPHQL_VALIDATION_FAILED" }
},
{
"message": "Field \"metadata\" of type \"[Pair]\" must have a selection of subfields. Did you mean \"metadata { ... }\"?",
"locations": [{ "line": 1, "column": 122 }],
"extensions": { "code": "GRAPHQL_VALIDATION_FAILED" }
},
{
"message": "Cannot query field \"omitempty\" on type \"Event\".",
"locations": [{ "line": 1, "column": 131 }],
"extensions": { "code": "GRAPHQL_VALIDATION_FAILED" }
}
],
"data": null,
"extensions": {
"tracing": {
"version": 1,
"startTime": "2024-08-10T00:27:14.447130557Z",
"endTime": "2024-08-10T00:27:14.44726538Z",
"duration": 134833,
"parsing": { "startOffset": 58384, "duration": 21013 },
"validation": { "startOffset": 79471, "duration": -9223372036854775808 },
"execution": { "resolvers": null }
}
}
}
The library doesn't support omitempty
tag. You should remove them.
Thanks for your response. That's embarrassing. I was only paying attention to the error on the metadata field. It looks like including the array structure in the query is indeed the right thing to do and it works fine after removing the omit tags.
I am missing a piece of information.
I'm trying a query like below, but it fails graphql validation. Normally, in the playground, you wouldn't specify anything about an array in the query, just the fields. But it seems like the client puts the response data into the same query structure, so an array is needed for the response.