Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MutationButtonProps

Difference with Vulcan Meteor: there is no registered mutation anymore, so you need to pass your mutations explicitely, using graphql

Hierarchy

  • MutationButtonProps

Index

Properties

Optional label

label: ReactNode

Shortcut for loadingButtonProps.label

Optional loadingButtonProps

loadingButtonProps: LoadingButtonProps

Now isolated into their own object to avoid needed to explicitely pick/omit

mutation

mutation: string | DocumentNode
example

mutation: gqlmutation sampleMutation($input: Input) { hello },

Optional mutationArguments

mutationArguments: OperationVariables

Variables passed to the mutation (NOTE: we can't pass other options at the moment)

Optional mutationOptions

mutationOptions: MutationHookOptions<any, OperationVariables, DefaultContext, ApolloCache<any>>

NOTE: in Vulcan Meteor you had to write: mutationOptions: { name: "foobar", mutationOptions: {refetchQueries:["hello"]}}

In Vulcan Next, you can only pass the "mutationOptions" object: mutationOptions: { refetchQueries:["hello"]} and the mutation is provided via the new "mutation" prop

Methods

Optional errorCallback

  • errorCallback(err: any): void | Promise<void>
  • Parameters

    • err: any

    Returns void | Promise<void>

Optional submitCallback

  • submitCallback(mutationArgumentsFromProps: undefined | OperationVariables): void | { mutationArguments: undefined | OperationVariables } | Promise<void | { mutationArguments: undefined | OperationVariables }>
  • Callback run before submitting. Can optionnaly return mutationArguments that will override current ones.

    Parameters

    • mutationArgumentsFromProps: undefined | OperationVariables

    Returns void | { mutationArguments: undefined | OperationVariables } | Promise<void | { mutationArguments: undefined | OperationVariables }>

Optional successCallback

  • successCallback(res: any): void | Promise<void>
  • Parameters

    • res: any

    Returns void | Promise<void>

Generated using TypeDoc