Skip to content

Add clientId in ApolloMutation component #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/api/apollo-mutation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- `update`: See [updating cache after mutation](https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-mutation-options-update)
- `refetchQueries`: See [refetching queries after mutation](https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-mutation-options-refetchQueries)
- `tag`: String HTML tag name (default: `div`)
- `clientId`: Used to resolve the Apollo Client used (defined in ApolloProvider)

## Scoped slot props

Expand Down
6 changes: 6 additions & 0 deletions src/components/ApolloMutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export default {
default: undefined,
},

clientId: {
type: String,
default: undefined,
},

tag: {
type: String,
default: 'div',
Expand All @@ -46,6 +51,7 @@ export default {
this.error = null
this.$apollo.mutate({
mutation: this.mutation,
client: this.clientId,
variables: this.variables,
optimisticResponse: this.optimisticResponse,
update: this.update,
Expand Down