SHARE
TWEET

Untitled

a guest Mar 21st, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import gql from 'graphql-tag'
  2.  
  3. const mutation = gql`
  4.   mutation CreateGuest {
  5.     createGuest {
  6.       token
  7.     }
  8.   }
  9. `
  10.  
  11. export default async vm => {
  12.   return await vm.$apollo
  13.     .mutate({
  14.       mutation,
  15.       variables: {},
  16.       update: (store, { data: { createGuest } }) => {
  17.         vm.createGuest = createGuest
  18.       }
  19.     })
  20.     .then(({ data: { createGuest } }) => {
  21.       return createGuest
  22.     })
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top