Skip to content

Instantly share code, notes, and snippets.

@helloncanella
Created October 15, 2019 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helloncanella/16966df614521117abe976ae22e0fd30 to your computer and use it in GitHub Desktop.
Save helloncanella/16966df614521117abe976ae22e0fd30 to your computer and use it in GitHub Desktop.
const LIST = gql`
query List($category: String!) {
list(category: $category) {
id
description
}
}
`
const [list, setList] = useAppState({
query: LIST,
variables: { category: "to-be-done" }
})
const todo = {
id: "1234",
description: "Take the cat to the vet 🐱 🏥‍ ",
__typename: "Item"
}
setList([...(list || []), todo])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment