/** * Custom mutation hook for platformInfraSetManyAndCommit * @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 { PlatformInfraSetManyAndCommitVariables } from '../../orm/mutation'; import type { PlatformInfraSetManyAndCommitPayloadSelect, PlatformInfraSetManyAndCommitPayload, } from '../../orm/input-types'; import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; export type { PlatformInfraSetManyAndCommitVariables } from '../../orm/mutation'; export type { PlatformInfraSetManyAndCommitPayloadSelect } from '../../orm/input-types'; export function usePlatformInfraSetManyAndCommitMutation< S extends PlatformInfraSetManyAndCommitPayloadSelect, >( params: { selection: { fields: S & PlatformInfraSetManyAndCommitPayloadSelect; } & HookStrictSelect, PlatformInfraSetManyAndCommitPayloadSelect>; } & Omit< UseMutationOptions< { platformInfraSetManyAndCommit: InferSelectResult< PlatformInfraSetManyAndCommitPayload, S > | null; }, Error, PlatformInfraSetManyAndCommitVariables >, 'mutationFn' > ): UseMutationResult< { platformInfraSetManyAndCommit: InferSelectResult< PlatformInfraSetManyAndCommitPayload, S > | null; }, Error, PlatformInfraSetManyAndCommitVariables > { const args = buildSelectionArgs(params.selection); const { selection: _selection, ...mutationOptions } = params ?? {}; void _selection; return useMutation({ mutationKey: customMutationKeys.platformInfraSetManyAndCommit(), mutationFn: (variables: PlatformInfraSetManyAndCommitVariables) => getClient() .mutation.platformInfraSetManyAndCommit(variables, { select: args.select, } as { select: S; } & StrictSelect) .unwrap(), ...mutationOptions, }); }