File tree Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div >
3
- <div v-if =" loading" >Loading</div >
3
+ <div v-if =" loading" >Loading</div >
4
4
5
5
<div v-if =" user" >
6
6
<div >Email: {{ user.email }}</div >
16
16
</template >
17
17
18
18
<script >
19
- import { reactive , ref } from ' vue'
20
- import { useQuery , useMutation , useResult } from " @vue/apollo-composable" ;
19
+ import {reactive , ref } from ' vue'
20
+ import {useQuery , useMutation , useResult } from ' @vue/apollo-composable'
21
21
import {updateUserMutation , getUserQuery } from ' ./VueApollo/queries'
22
- import {gql } from ' apollo-boost'
23
-
24
22
25
23
export default {
26
24
props: {
@@ -31,20 +29,18 @@ export default {
31
29
},
32
30
setup (props ) {
33
31
const email = ref (' ' )
34
-
35
- const { result , loading , error } = useQuery (getUserQuery, {id: props .id })
32
+
33
+ const {result , loading , error } = useQuery (getUserQuery, {id: props .id })
36
34
const user = useResult (result, null , data => data .user )
37
35
38
- const {mutate: updateUser } = useMutation (updateUserMutation,
39
- ()=> ({variables:
40
- {
41
- input: {
42
- email: email .value ,
43
- id: props .id ,
44
- },
45
- }
46
- })
47
- )
36
+ const {mutate: updateUser } = useMutation (updateUserMutation, () => ({
37
+ variables: {
38
+ input: {
39
+ email: email .value ,
40
+ id: props .id ,
41
+ },
42
+ },
43
+ }))
48
44
49
45
return {
50
46
email,
You can’t perform that action at this time.
0 commit comments