UNPKG

@sparklink-pro/apant

Version:

Apollo & Antd tools

21 lines 964 B
import { useMutation } from '@apollo/client/react'; import { GraphQLType, TypeOperationMutation } from '../definitions'; export type useTypeMutationOptions = { type: GraphQLType; operation: TypeOperationMutation; refreshList?: boolean; } & useMutation.Options; /** * This hook executes a mutation for a given type. It use `useMutation` to perform a GraphQL mutation. * It will use the default mutation operation defined in the registry (OPERATION_CREATE, OPERATION_DELETE, OPERATION_UPDATE) for the type. * The mutation is expected to return a valid payload of the form `{ item: {} }`. */ export declare const useTypeMutation: ({ type, operation, refreshList, ...options }: useTypeMutationOptions) => { data: unknown; loading: boolean; mutate: useMutation.MutationFunction<unknown, { [x: string]: any; }, import("@apollo/client").ApolloCache>; }; export default useTypeMutation; //# sourceMappingURL=useTypeMutation.d.ts.map