Open humphrey opened 9 months ago
Hi!
Can you share the mutation that leads to that error?
Hi!
Can you share the mutation that leads to that error?
Sure thing! Here is the mutation.
mutation UpdatePrefs($data: UpdatePrefsInput!) {
updatePrefs(data: $data) {
...MyPrefs
... on InputError { message }
... on FieldError {
message
fieldErrors { field, messages }
}
}
}
fragment MyPrefs on MyPrefs { dateFormat, firstDayOfWeek }
And here is a full cut down schema needed to reproduce. FYI, this is a simple reproducable adaption from my real schema and mutation (I've deleted most of my code and renamed a number of things for this example). I copied this to a new project with just a schema.graphql and a .graphql file for my mutation, and I get the same error.
union UpdatePrefsResponse = MyPrefs | FieldErrors | SimpleMutationError
type Mutation {
updatePrefs(data: UpdatePrefsInput!): UpdatePrefsResponse!
}
input UpdatePrefsInput {
dateFormat: String!
firstDayOfWeek: Int!
}
type MyPrefs {
dateFormat: String!
firstDayOfWeek: Int!
}
interface InputError {
message: String!
}
type FieldErrors implements InputError {
message: String!
fieldErrors: [FieldErrorsField!]!
}
type FieldErrorsField {
field: String!
messages: [String!]!
}
type SimpleMutationError implements InputError {
message: String!
}
Thanks!
This might be an issue with fragments spreads on a specific case of a union. will take a look
I have the same problem, too
Does Ferry support mutations that return Union types such as the example snippet below?
Whenever I try to generate classes for a mutation that returns a union such as this (my graph is full of them) I get the following error:
Or is there something else going on? My apologies if this is a noob question - this is my first attempt to use ferry for a project (I'm attempting to port my existing graphql_codegen project to ferry)