Skip to content

Commit

Permalink
add onCompleted option to useMutation
Browse files Browse the repository at this point in the history
  • Loading branch information
DarynaAkhmedova committed Aug 15, 2024
1 parent 1010df3 commit f382ea5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/nova-react/src/graphql/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ interface MutationCommitterOptions<TMutationPayload extends OperationType> {
*/
context?: TMutationPayload["context"];
optimisticResponse?: Partial<TMutationPayload["response"]> | null;
onCompleted?: (response: TMutationPayload["response"]) => void;
}

type MutationCommitter<TMutationPayload extends OperationType> = (
Expand Down
1 change: 1 addition & 0 deletions packages/nova-types/src/nova-graphql.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface NovaGraphQL<GraphQLDocument = any> {
variables: { [name: string]: unknown };
context?: { [name: string]: unknown };
optimisticResponse?: unknown | null;
onCompleted?: (response: unknown) => void;
}) => Promise<{ errors?: readonly Error[]; data?: unknown }>,
boolean,
];
Expand Down

0 comments on commit f382ea5

Please sign in to comment.