Open
Description
Holla!
.mutate()
method of apollo-angular uses FetchResult<T>
for the return type, which internally uses ExecutionResult<T>
from graphql module itself. The data
property in ExecutionResult
defined as optional and nullable. This brings problems because TS always complain that data might be null
even when your mutation result is neve nullable (we use types generated from the schema). So you have to fight with nullability and of course, it's confusing because the schema result is non-nullable.
In contradiction query
method defines data as data<T>
, so we don't have this problem for queries.
What would be a solution to this?