mobxjs / mst-gql

Bindings for mobx-state-tree and GraphQL
MIT License
681 stars 81 forks source link

Scaffolding tool breaks on multidimensional array types #420

Open DonnyVerduijn opened 1 year ago

DonnyVerduijn commented 1 year ago

The scaffolding tool seems to be incompatible with schemas that contain multidimensional fields. During scaffolding, the error TypeError: Cannot read properties of null (reading '0') is thrown and the procedure is aborted.

A small example:

type Subscription {
  gridState(id: ID!): [[Cell!]!]!
}

I can confirm that after removing the specific multidimensional field, the problem was resolved. Not sure if this is a problem that should be fixed, but it seems a GraphQL spec compliant feature. As an alternative, we could add a small notice in the readme.