graphql-cli-generate-fragments icon indicating copy to clipboard operation
graphql-cli-generate-fragments copied to clipboard

Fragment not generated for array fields

Open matteby opened this issue 6 years ago • 1 comments
trafficstars

I have a schema that has an array field (notificationEmails in the example below). The generated fragment for this schema is missing the field.

Example schema:

type Note {
  text: String!
}

type Step {
  name: String!
  note: Note
  notificationEmails: [String!]
}

Generated fragment:

fragment Note on Note {
  text
}

fragment Step on Step {
  name
  note {
    ...NoteNoNesting
  }
}

Is there anything I may be doing wrong here?

matteby avatar Feb 20 '19 22:02 matteby

👍 I have the same problem with resolver that return union... generated fragments does not contain resolver...

union Note = Headline | Paragraph

type Step {
  name: String!
  note: Note
  notificationEmails: [String!]
}

Generated fragments

fragment Step on Step {
  name
  notificationEmails
}

mehdibeldjilali avatar Sep 20 '19 15:09 mehdibeldjilali