/** * Custom mutation hook for insertNodesAtPaths * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ import { useMutation } from '@tanstack/react-query'; import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; import { getClient } from '../client'; import { buildSelectionArgs } from '../selection'; import type { SelectionConfig } from '../selection'; import { customMutationKeys } from '../mutation-keys'; import type { InsertNodesAtPathsVariables } from '../../orm/mutation'; import type { InsertNodesAtPathsPayloadSelect, InsertNodesAtPathsPayload, } from '../../orm/input-types'; import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; export type { InsertNodesAtPathsVariables } from '../../orm/mutation'; export type { InsertNodesAtPathsPayloadSelect } from '../../orm/input-types'; export function useInsertNodesAtPathsMutation( params: { selection: { fields: S & InsertNodesAtPathsPayloadSelect; } & HookStrictSelect, InsertNodesAtPathsPayloadSelect>; } & Omit< UseMutationOptions< { insertNodesAtPaths: InferSelectResult | null; }, Error, InsertNodesAtPathsVariables >, 'mutationFn' > ): UseMutationResult< { insertNodesAtPaths: InferSelectResult | null; }, Error, InsertNodesAtPathsVariables > { const args = buildSelectionArgs(params.selection); const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.insertNodesAtPaths(), mutationFn: (variables: InsertNodesAtPathsVariables) => getClient() .mutation.insertNodesAtPaths(variables, { select: args.select, } as { select: S; } & StrictSelect) .unwrap(), ...mutationOptions, }); }