1 | import * as PropTypes from 'prop-types';
|
2 | import { useMutation } from "../hooks/index.js";
|
3 | export function Mutation(props) {
|
4 | var _a = useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
|
5 | return props.children ? props.children(runMutation, result) : null;
|
6 | }
|
7 | Mutation.propTypes = {
|
8 | mutation: PropTypes.object.isRequired,
|
9 | variables: PropTypes.object,
|
10 | optimisticResponse: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
|
11 | refetchQueries: PropTypes.oneOfType([
|
12 | PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),
|
13 | PropTypes.func
|
14 | ]),
|
15 | awaitRefetchQueries: PropTypes.bool,
|
16 | update: PropTypes.func,
|
17 | children: PropTypes.func.isRequired,
|
18 | onCompleted: PropTypes.func,
|
19 | onError: PropTypes.func,
|
20 | fetchPolicy: PropTypes.string,
|
21 | };
|
22 |
|
\ | No newline at end of file |