Skip to content

FetchtResult for mutation #1477

Open
Open
@fetis

Description

@fetis

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions