graphqlgen
graphqlgen copied to clipboard
Incorrect type for arrays of arrays resolver
Description
Graphqlgen does not seem to handle arrays of arrays properly. Instead, it treats them as 1 dimensional array.
Steps to reproduce
yarn create graphqlgen my-app
Edit the schema.graphql file and add a field data
inside the type Post
:
type Post {
id: ID!
title: String!
content: String!
published: Boolean!
author: User!
data: [[Float]!]!
}
Expected results
PostResolvers.type
should define a data resolver that returns an array of array of number.
Something like:
data: (
parent: Post,
args: {},
ctx: Context,
info: GraphQLResolveInfo
) => Array<Array<number | null>> | Promise<Array<Array<number | null>>>;
Actual results
Instead this is what is generated:
data: (
parent: Post,
args: {},
ctx: Context,
info: GraphQLResolveInfo
) => Array<number | null> | Promise<Array<number | null>>;
Versions
- graphqlgen: 0.5.1
- OS name and version: macOS 10.14.2
Also tested with 0.6.0-rc9. Same behavior.
Any updates on this?