graphqlgen icon indicating copy to clipboard operation
graphqlgen copied to clipboard

Incorrect type for arrays of arrays resolver

Open sarfata opened this issue 6 years ago • 2 comments

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

sarfata avatar Feb 20 '19 22:02 sarfata

Also tested with 0.6.0-rc9. Same behavior.

sarfata avatar Feb 20 '19 22:02 sarfata

Any updates on this?

devakrishna33 avatar Jan 16 '20 09:01 devakrishna33