Query result not delivered to component if array contains null values
See original GitHub issueI have an issue where my query works in Graphiql in my browser, but wont work for me in my React Native app.
This is a condensed version of the query:
team(_id: $teamId) {
_id
history {
score
}
}
If I don’t request history
it works for me in RN too. When I do request history
I don’t get any data back from the server for team. The server is getting the request and sending back data from my server console logs.
And the definition of team (condensed) is:
type Team {
_id: ID
history: [FixtureHistory]
}
type FixtureHistory {
lineup: [String]
subs: [String]
score: Int
finalLineup: [String]
finalSubs: [String]
autoSubs: [AutoSub]
players: [Player]
}
Any idea why this works fine in Graphiql but not with Apollo Client on React Native?
Issue Analytics
- State:
- Created 6 years ago
- Comments:20 (6 by maintainers)
Top Results From Across the Web
How to check if array element is null to avoid ... - Stack Overflow
The given code works for me. Notice that someArray[i] is always null since you have not initialized the second dimension of the array....
Read more >Filter query where select component is null or ... - Retool Forum
I want to filter my query by the value of an input text component and the value of a dropdown component. I have...
Read more >Work with arrays | BigQuery - Google Cloud
In Google Standard SQL for BigQuery, an array is an ordered list consisting of zero or more values of the same data type....
Read more >Empty arrays and collections should be returned instead of null
Returning null instead of an actual array, collection or map forces callers of the method to explicitly test for nullity, making them more...
Read more >where() Function - Appian 22.2
If a default value is not specified and none of the values in the input array are true, an empty list will be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@elie222 I found the bug and fixed it, just have to write a test for it. I’ll release it later today 🎉
I finally found the source of the error based on your comments @jagare. Note, this is specific to Apollo, all works fine in graphiql and looks like it should work fine. Seems to be a bug with Apollo.
Apollo wasn’t happy with me sending
null
in the array.This works fine:
This doesn’t work fine:
This is the schema we’re talking about btw (and in the error repo I posted above):