|
3 | 3 | **CustomerGraphQl** provides type and resolver information for the GraphQl module
|
4 | 4 | to generate customer information endpoints.
|
5 | 5 |
|
6 |
| -This module implements the M2 dev customer endpoints and provides new. |
| 6 | +This module extends the M2 GraphQl customer queries and mutations. |
7 | 7 | New endpoints will be documented in future releases.
|
8 | 8 |
|
9 |
| -Modules is divided in two parts: |
10 |
| -- `overwrite` – simply overwrites M2 core files with M2 dev customer account features |
11 |
| -- `src` – the ScandiPWA module with updated GraphQL schema and new Resolver for new fields. |
12 |
| - |
13 |
| -## Custom endpoint documentation |
14 |
| - |
15 |
| -### Mutation `createCustomer` |
16 |
| - |
17 |
| -Here is an example use of it: |
18 |
| - |
19 |
| - ```graphql |
20 |
| -mutation CreateCustomer( |
21 |
| - $firstname: String! |
22 |
| - $password: String! |
23 |
| - $lastname: String! |
24 |
| - $email: String! |
25 |
| - $addresses: [CreateCustomerAddressInput!] |
26 |
| -) { |
27 |
| - createCustomer( |
28 |
| - customer: { |
29 |
| - firstname: $firstname |
30 |
| - lastname: $lastname |
31 |
| - email: $email |
32 |
| - addresses: $addresses |
33 |
| - } |
34 |
| - password: $password |
35 |
| - ) { |
36 |
| - status |
37 |
| - token |
38 |
| - customer { |
39 |
| - id |
40 |
| - firstname |
41 |
| - lastname |
42 |
| - email |
43 |
| - is_subscribed |
44 |
| - addresses { |
45 |
| - city |
46 |
| - country_id |
47 |
| - street |
48 |
| - telephone |
49 |
| - firstname |
50 |
| - lastname |
51 |
| - postcode |
52 |
| - street |
53 |
| - default_shipping |
54 |
| - default_billing |
55 |
| - } |
56 |
| - } |
57 |
| - } |
58 |
| -} |
59 |
| -``` |
60 |
| - |
61 |
| -The variables for input above might look like: |
62 |
| - |
63 |
| -```json |
64 |
| -{ |
65 |
| - "firstname": "Alfred", |
66 |
| - "lastname": "Genkin", |
67 |
| - |
68 |
| - "password": "Testing123_", |
69 |
| - "addresses": [ |
70 |
| - { |
71 |
| - "firstname": "Alfreds", |
72 |
| - "lastname": "Genkins", |
73 |
| - "telephone": "22522240", |
74 |
| - "country_id": "US", |
75 |
| - "city": "My awesome city", |
76 |
| - "street": [ "My cool street 11" ], |
77 |
| - "postcode": "My awesome US postal code" |
78 |
| - } |
79 |
| - ] |
80 |
| -} |
81 |
| -``` |
| 9 | +## Custom query documentation |
82 | 10 |
|
83 | 11 | ### Mutation `forgotPassword`
|
84 | 12 |
|
@@ -200,4 +128,4 @@ The variables for input above might look like:
|
200 | 128 | {
|
201 | 129 |
|
202 | 130 | }
|
203 |
| -``` |
| 131 | +``` |
0 commit comments