Created
September 27, 2018 14:02
-
-
Save jbaxleyiii/cd51c445aaca1e9fb6599e7e8f5c673a to your computer and use it in GitHub Desktop.
This file contains 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 query = gql` | |
# query CartItems { | |
# cartItemIds @client @export(as: "ids") | |
# } | |
query Cart($ids: [Id]!) { | |
# $ids: cartItemIds @client | |
cartItemIds @client @export(as: "ids") | |
cart(itemIds: $ids) { | |
items { | |
name | |
} | |
} | |
} | |
`; | |
const mutation = gql` | |
mutation { | |
createUser(id: 1) { | |
user { | |
id | |
} | |
} | |
saveUser(id: 1) @client | |
} | |
`; | |
const localMutation = gql` | |
mutation { | |
saveUser(id: 1) @client | |
} | |
`; | |
const withLocalData = gql` | |
query CartItems { | |
items @client @export(as "ids") { | |
id | |
} | |
} | |
mutation SaveCartItems { | |
saveCart($ids: [ID]!) { | |
saveCart(ids: $ids) | |
} | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment