Skip to content

Mutations generic type arguments broken (ts) #773

Closed
@ruisaraiva19

Description

@ruisaraiva19

Issue

With the vue-apollo@v3.0.0-rc.3 release, we can't explicitly say the $apollo.mutate method return type for the mutation result data value.

Example

const { data } = await this.$apollo.mutate<MutationResultInterface>({
  mutation: gql`mutation () { }`,
  variables: {
    id: 12345
  }
})

Version v3.0.0-rc.2

IDE knows that data is of type MutationResultInterface

Version v3.0.0-rc.3

IDE shows the thrown error: this.$apollo.mutate is expecting 0 type arguments, but got 1.

How do we explicitly say the return data type of a mutation now on v3.0.0-rc.3?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions