Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Incorrect type for arrays of arrays resolver #457

Open
sarfata opened this issue Feb 20, 2019 · 2 comments
Open

Incorrect type for arrays of arrays resolver #457

sarfata opened this issue Feb 20, 2019 · 2 comments
Labels
bug/1-repro-available A reproduction exists and needs to be confirmed. kind/bug status/pr-welcome
Milestone

Comments

@sarfata
Copy link

sarfata commented Feb 20, 2019

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
Copy link
Author

sarfata commented Feb 20, 2019

Also tested with 0.6.0-rc9. Same behavior.

@jasonkuhrt jasonkuhrt added bug/1-repro-available A reproduction exists and needs to be confirmed. status/pr-welcome labels Feb 21, 2019
@jasonkuhrt jasonkuhrt pinned this issue Feb 21, 2019
@jasonkuhrt jasonkuhrt added this to the 0.6.0 milestone Feb 21, 2019
@devakrishna33
Copy link

Any updates on this?

@janpio janpio unpinned this issue Dec 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/1-repro-available A reproduction exists and needs to be confirmed. kind/bug status/pr-welcome
Projects
None yet
Development

No branches or pull requests

4 participants