apollo-elements/apollo-elements

View on GitHub
docs/decks/azconf-dev-2021/slides/54-apollo-mutation-controller.md

Summary

Maintainability
Test Coverage
---
name: ApolloMutationController
---

## `ApolloMutationController`

- Fires Mutations to your GraphQL server
- Provides a `mutate()` function with options:
    - `variables`
    - `optimisticResponse`, etc.
- Maintains the state of the request
    - `data` - the mutation result
    - `loading`
    - `error`
- `update` function or `refetchQueries` to manage cache