Skip to content

Instantly share code, notes, and snippets.

@peggyrayzis
Last active December 21, 2017 20:54
Show Gist options
  • Save peggyrayzis/6ccc63680176fd3c4fe9cdd43c58ee81 to your computer and use it in GitHub Desktop.
Save peggyrayzis/6ccc63680176fd3c4fe9cdd43c58ee81 to your computer and use it in GitHub Desktop.
Example of a client mutation with apollo-link-state
const SET_VISIBILITY = gql`
mutation SetFilter($filter: String!) {
visibilityFilter(filter: $filter) @client
}
`;
const setVisibilityFilter = graphql(SET_VISIBILITY, {
props: ({ mutate, ownProps }) => ({
onClick: () => mutate({ variables: { filter: ownProps.filter } }),
}),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment