This works fine in GraphiQL, but when I use it in Apollo Client I get
Can't find field value on result object $ROOT_QUERY.multidimensional().rows.0."
networkErrorHypothetical Schema
type Table {
rows: [ [ Cell ] ] # This is causing issues
}
type Cell {
value: Float
}
{
multidimensional() {
table {
rows {
value
}
}
}
}
[
[{ value: 1 }],
[{ value: 2 }],
[{ value: 3 }]
]
This works as expected when testing with GraphiQL.
In Apollo client this throws an error.
The issue is made apparent in const value: any = result[resultFieldKey]; because resultFieldKey is value, but result is an _array_ of Cell types, rather than a single Cell type.
I feel like I tried many alternative query and schema layouts to work around this issue, but none have helped. I've only have a few hours of experience using GraphQL and Apollo, so I will be excited to learn if I'm doing something incorrectly or this is an issue that can be fixed in the client.
Thank you!
I think this is an accidental oversight that will be fixed in Apollo Client 0.5, since we've now refactored to use graphql-anywhere: https://github.com/apollostack/graphql-anywhere
We're hoping to publish a 0.5 preview in the next day or two, I'll make sure to post here.
I can verify that the nested array issue I reported is now working for me using [email protected]. Thank you for the super quick turnaround!