File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
import Resource from './resource' ;
2
+ import defaultResolver from './default-resolver' ;
2
3
import handleCustomerMutation from './handle-customer-mutation' ;
3
4
4
5
// GraphQL
6
+ import customerNodeQuery from './graphql/customerNodeQuery.graphql' ;
7
+
5
8
import customerCreateMutation from './graphql/customerCreateMutation.graphql' ;
6
9
7
10
import customerAccessTokenCreateMutation from './graphql/customerAccessTokenCreateMutation.graphql' ;
@@ -28,6 +31,11 @@ import customerUpdateMutation from './graphql/customerUpdateMutation.graphql';
28
31
* @class
29
32
*/
30
33
class CustomerResource extends Resource {
34
+ fetch ( customerAccessToken ) {
35
+ return this . graphQLClient
36
+ . send ( customerNodeQuery , { customerAccessToken} )
37
+ . then ( defaultResolver ( 'customer' ) )
38
+ }
31
39
32
40
/**
33
41
* Creates a customer.
Original file line number Diff line number Diff line change
1
+ query ($customerAccessToken : String ! ) {
2
+ customer (customerAccessToken : $customerAccessToken ) {
3
+ id
4
+ firstName
5
+ lastName
6
+ attributes
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments