You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my code I use the following type to represent points in 2d
type Vec2 [2]float64
I realize that graphql does not have any explicit representation for fixed-size arrays so I'm happy to expose this in the api as simple a list of floats, ie
graphql.NewList(graphql.Float)
However, when I register this field, I get an error saying that my field is not iterable. If instead I return a slice from my resolver then I get the expected behavior. This is rather frustrating as I have to manually register a resolver everywhere that I return a Vec2 to turn the array into a slice.
I think this library should recognize fixed-size arrays as iterable.
The text was updated successfully, but these errors were encountered:
In my code I use the following type to represent points in 2d
I realize that graphql does not have any explicit representation for fixed-size arrays so I'm happy to expose this in the api as simple a list of floats, ie
However, when I register this field, I get an error saying that my field is not iterable. If instead I return a slice from my resolver then I get the expected behavior. This is rather frustrating as I have to manually register a resolver everywhere that I return a
Vec2
to turn the array into a slice.I think this library should recognize fixed-size arrays as iterable.
The text was updated successfully, but these errors were encountered: