Skip to content

@vue/apollo-composable / useMutation / ReactiveVariablesParameter

Type Alias: ReactiveVariablesParameter ​

ReactiveVariablesParameter = MaybeRefOrGetter<OperationVariables> | Record<string, MaybeRefOrGetter<any>>

Type for the variables option parameter: either a ref/getter of the full variables object, or an object mapping individual variable names to refs/getters.

Example ​

ts
// Single ref/getter for all variables
const variables = reactive({ text: 'Hello' })
useMutation(mutation, { variables })

// Object mapping individual variable names to refs/getters
const text = ref('Hello')
useMutation(mutation, { variables: { text } })

Released under the MIT License.