Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
TProps extends TGraphQLVariables | {} = {},
TData = {},
TGraphQLVariables = {},
TChildProps = Partial> &
Partial>
>(
document: DocumentNode,
operationOptions: OperationOption<
TProps,
TData,
TGraphQLVariables,
TChildProps
> = {}
) {
switch (parser(document).type) {
case DocumentType.Mutation:
return withMutation(document, operationOptions);
case DocumentType.Subscription:
return withSubscription(document, operationOptions);
case DocumentType.Query:
default:
return withQuery(document, operationOptions);
}
}
constructor({
options,
context,
result,
setResult
}: {
options: MutationOptions;
context: ApolloContextValue;
result: MutationResult;
setResult: (result: MutationResult) => any;
}) {
super(options, context);
this.verifyDocumentType(options.mutation, DocumentType.Mutation);
this.result = result;
this.setResult = setResult;
this.mostRecentMutationId = 0;
}