Last active
December 21, 2017 20:53
-
-
Save peggyrayzis/80ef21d3d7c9f0fa41918de737bc68d5 to your computer and use it in GitHub Desktop.
Example of a client query in apollo-link-state
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const GET_USERS_ACTIVE_TODOS = gql` | |
{ | |
visibilityFilter @client | |
user(id: 1) { | |
name | |
address | |
} | |
} | |
`; | |
const withActiveState = graphql(GET_USERS_ACTIVE_TODOS, { | |
props: ({ ownProps, data }) => ({ | |
active: ownProps.filter === data.visibilityFilter, | |
data, | |
}), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment