import { Injectable } from '@angular/core' ; import type { DocumentNode } from 'graphql' ; import type { TypedDocumentNode } from '@apollo/client/core' ; import { Apollo } from './apollo' ; import { MutationOptionsAlone , EmptyObject } from './types' ; @ Injectable ( ) export class Mutation < T = { } , V = EmptyObject > { public readonly document : DocumentNode | TypedDocumentNode < T , V > ; public client = 'default' ; constructor ( protected apollo ) { } public mutate ( variables ? , options ? ) { return this . apollo . use ( this . client ) . mutate < T , V > ( { ... options , variables , mutation : this . document , } ) ; } }