case class UseMutation[T, TVars <: Object]() extends Product with Serializable
Because there are some duplicative types in the signatures which become burdensome, this helper class reduces type noise. Instantiate the object then use values and methods in it without need to always specify the types.
- Alphabetic
- By Inheritance
- UseMutation
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new UseMutation()
Value Members
- def makeClientOptions(mutation: DocumentNode, context: UndefOr[Object] = js.undefined, fetchPolicy: UndefOr[FetchPolicy] = js.undefined, errorPolicy: UndefOr[ErrorPolicy] = js.undefined, variables: UndefOr[TVars] = js.undefined, unsafeVariables: UndefOr[Dynamic] = js.undefined, update: UndefOr[MutationUpdaterFn[T]] = js.undefined, awaitRefetchQueries: UndefOr[Boolean] = js.undefined, updateQueries: UndefOr[MutationQueryReducersMap[T, Object]] = js.undefined, optimisticResponse: UndefOr[|[T, Function1[TVars, T]]] = js.undefined): MutationOptions[T, TVars]
Make apollo_client.QueryOptions for the ApolloClient returned from
useMutation
which are slightly different thanMutationHookOptions
used in the hook! This primarily exists so we can get ajs.Promise
to throw an exception to the suspense mechanism. - def makeFunctionOptions(unsafeVariables: UndefOr[Dynamic] = js.undefined, variables: UndefOr[TVars] = js.undefined, optimisticResponseStrict: UndefOr[T] = js.undefined, optimisticResponse: UndefOr[Function1[TVars, T]] = js.undefined, refetchQueriesByName: UndefOr[Array[String]] = js.undefined, awaitRefetchQueries: UndefOr[Boolean] = js.undefined, update: UndefOr[MutationUpdaterFn[T]] = js.undefined, context: UndefOr[Object] = js.undefined, fetchPolicy: UndefOr[WatchQueryFetchPolicy] = js.undefined): MutationFunctionOptions[T, TVars]
Options needed for the "caller" function return from the mutation hook.
Options needed for the "caller" function return from the mutation hook. Other config info, such as error policy and the operation itself are take from the hook.
- def makeOptions(awaitRefetchQueries: UndefOr[Boolean] = js.undefined, client: UndefOr[ApolloClient] = js.undefined, context: UndefOr[Object] = js.undefined, errorPolicy: UndefOr[ErrorPolicy] = js.undefined, fetchPolicy: UndefOr[WatchQueryFetchPolicy] = js.undefined, ignoreResults: UndefOr[Boolean] = js.undefined, mutation: UndefOr[DocumentNode] = js.undefined, notifyOnNetworkStatusChange: UndefOr[Boolean] = js.undefined, onCompleted: UndefOr[Function1[UndefOr[T], Unit]] = js.undefined, onError: UndefOr[Function1[ApolloError, Unit]] = js.undefined, update: UndefOr[MutationUpdaterFn[T]] = js.undefined, variables: UndefOr[TVars] = js.undefined, unsafeVariables: UndefOr[Dynamic] = js.undefined): MutationHookOptions[T, TVars]
Make MutationHookOptions
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def useMutation(mutation: DocumentNode, options: UndefOr[|[MutationHookOptions[T, TVars], Dynamic]] = js.undefined): (Function1[MutationFunctionOptions[T, TVars], Promise[ExecutionResult[T]]], MutationResult[T])