Open
Description
Describe the bug
The typing of result.data
in the onDone
event hook (returned by useMutation
and useQuery
) is MyResult | null | undefined
.
To Reproduce
const { mutate, onDone } = useMutation(MyTypedDocument)
onDone((result) => {
// The type of result.data is `MyResult | null | undefined`
})
Expected behavior
onDone: Event hook called when the mutation successfully completes.
I would expect that a successfull mutation / query cannot return null | undefined
unless the GraphQL response type is nullable (which it is not in my case).
Versions
vue: 2.6.14
vue-apollo: 4.0.0-alpha.16
@apollo/client: 3.5.8
Metadata
Metadata
Assignees
Labels
No labels