-
Notifications
You must be signed in to change notification settings - Fork 4
Union Return Type Support #2
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Thanks so much for this library, it's been incredibly helpful for the project I'm building. I was wondering if the following was supported:
schema:
type Mutation {
unionMethod(body: String): UnionType
}
type FieldError {
field: String
}
type Errors {
fieldErrors: [FieldError]
}
type MutationResponse {
ok: Boolean
}
union UnionType = Errors | MutationResponse
documents:
mutation unionMethod {
unionMethod(body: "test") {
...on Errors {
fieldErrors {
field
}
}
...on MutationResponse {
ok
}
}
}
Currently, this throws an exception TypeError: Cannot create property 'source' on string 'unhandled GraphQLOutputType in unwrap' which appears to be coming from an unhandled case in https://github.com/bearbytes/apollo-hooks-codegen/blob/master/src/transform.ts#L381 .
Are there plans to support this use case, or suggestions for the best way to handle it moving forward? Happy to provide a PR if you have a sense of what we might need.
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request