Skip to content

Commit 324d329

Browse files
committed
add examples
1 parent 44676a6 commit 324d329

15 files changed

Lines changed: 1786 additions & 4 deletions

File tree

example/cache-manager.test.ts

Lines changed: 462 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
"""
2+
Root query type
3+
"""
4+
type Query {
5+
"""
6+
Get user by ID
7+
"""
8+
user(
9+
"""
10+
User ID
11+
"""
12+
id: ID!
13+
): User
14+
15+
"""
16+
Get all users
17+
"""
18+
users: [User!]!
19+
}
20+
21+
"""
22+
Root mutation type
23+
"""
24+
type Mutation {
25+
"""
26+
Create a new user
27+
"""
28+
createUser(
29+
"""
30+
User input data
31+
"""
32+
input: CreateUserInput!
33+
): User
34+
}
35+
36+
"""
37+
User object
38+
"""
39+
type User {
40+
"""
41+
User ID
42+
"""
43+
id: ID!
44+
45+
"""
46+
User name
47+
"""
48+
name: String!
49+
50+
"""
51+
User email
52+
"""
53+
email: String!
54+
55+
"""
56+
User status
57+
"""
58+
status: UserStatus
59+
}
60+
61+
"""
62+
Input for creating a user
63+
"""
64+
input CreateUserInput {
65+
"""
66+
User name
67+
"""
68+
name: String!
69+
70+
"""
71+
User email
72+
"""
73+
email: String!
74+
}
75+
76+
"""
77+
User status enum
78+
"""
79+
enum UserStatus {
80+
"""
81+
User is active
82+
"""
83+
ACTIVE
84+
85+
"""
86+
User is inactive
87+
"""
88+
INACTIVE
89+
90+
"""
91+
User is suspended
92+
"""
93+
SUSPENDED
94+
}
Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
{
2+
"data": {
3+
"__schema": {
4+
"queryType": {
5+
"name": "Query"
6+
},
7+
"mutationType": {
8+
"name": "Mutation"
9+
},
10+
"subscriptionType": null,
11+
"types": [
12+
{
13+
"kind": "OBJECT",
14+
"name": "Query",
15+
"description": "Root query type",
16+
"fields": [
17+
{
18+
"name": "user",
19+
"description": "Get user by ID",
20+
"args": [
21+
{
22+
"name": "id",
23+
"description": "User ID",
24+
"type": {
25+
"kind": "NON_NULL",
26+
"name": null,
27+
"ofType": {
28+
"kind": "SCALAR",
29+
"name": "ID",
30+
"ofType": null
31+
}
32+
},
33+
"defaultValue": null
34+
}
35+
],
36+
"type": {
37+
"kind": "OBJECT",
38+
"name": "User",
39+
"ofType": null
40+
},
41+
"isDeprecated": false,
42+
"deprecationReason": null
43+
},
44+
{
45+
"name": "users",
46+
"description": "Get all users",
47+
"args": [],
48+
"type": {
49+
"kind": "NON_NULL",
50+
"name": null,
51+
"ofType": {
52+
"kind": "LIST",
53+
"name": null,
54+
"ofType": {
55+
"kind": "NON_NULL",
56+
"name": null,
57+
"ofType": {
58+
"kind": "OBJECT",
59+
"name": "User",
60+
"ofType": null
61+
}
62+
}
63+
}
64+
},
65+
"isDeprecated": false,
66+
"deprecationReason": null
67+
}
68+
],
69+
"inputFields": null,
70+
"interfaces": [],
71+
"enumValues": null,
72+
"possibleTypes": null
73+
},
74+
{
75+
"kind": "OBJECT",
76+
"name": "Mutation",
77+
"description": "Root mutation type",
78+
"fields": [
79+
{
80+
"name": "createUser",
81+
"description": "Create a new user",
82+
"args": [
83+
{
84+
"name": "input",
85+
"description": "User input data",
86+
"type": {
87+
"kind": "NON_NULL",
88+
"name": null,
89+
"ofType": {
90+
"kind": "INPUT_OBJECT",
91+
"name": "CreateUserInput",
92+
"ofType": null
93+
}
94+
},
95+
"defaultValue": null
96+
}
97+
],
98+
"type": {
99+
"kind": "OBJECT",
100+
"name": "User",
101+
"ofType": null
102+
},
103+
"isDeprecated": false,
104+
"deprecationReason": null
105+
}
106+
],
107+
"inputFields": null,
108+
"interfaces": [],
109+
"enumValues": null,
110+
"possibleTypes": null
111+
},
112+
{
113+
"kind": "OBJECT",
114+
"name": "User",
115+
"description": "User object",
116+
"fields": [
117+
{
118+
"name": "id",
119+
"description": "User ID",
120+
"args": [],
121+
"type": {
122+
"kind": "NON_NULL",
123+
"name": null,
124+
"ofType": {
125+
"kind": "SCALAR",
126+
"name": "ID",
127+
"ofType": null
128+
}
129+
},
130+
"isDeprecated": false,
131+
"deprecationReason": null
132+
},
133+
{
134+
"name": "name",
135+
"description": "User name",
136+
"args": [],
137+
"type": {
138+
"kind": "NON_NULL",
139+
"name": null,
140+
"ofType": {
141+
"kind": "SCALAR",
142+
"name": "String",
143+
"ofType": null
144+
}
145+
},
146+
"isDeprecated": false,
147+
"deprecationReason": null
148+
},
149+
{
150+
"name": "email",
151+
"description": "User email",
152+
"args": [],
153+
"type": {
154+
"kind": "NON_NULL",
155+
"name": null,
156+
"ofType": {
157+
"kind": "SCALAR",
158+
"name": "String",
159+
"ofType": null
160+
}
161+
},
162+
"isDeprecated": false,
163+
"deprecationReason": null
164+
},
165+
{
166+
"name": "status",
167+
"description": "User status",
168+
"args": [],
169+
"type": {
170+
"kind": "ENUM",
171+
"name": "UserStatus",
172+
"ofType": null
173+
},
174+
"isDeprecated": false,
175+
"deprecationReason": null
176+
}
177+
],
178+
"inputFields": null,
179+
"interfaces": [],
180+
"enumValues": null,
181+
"possibleTypes": null
182+
},
183+
{
184+
"kind": "INPUT_OBJECT",
185+
"name": "CreateUserInput",
186+
"description": "Input for creating a user",
187+
"fields": null,
188+
"inputFields": [
189+
{
190+
"name": "name",
191+
"description": "User name",
192+
"type": {
193+
"kind": "NON_NULL",
194+
"name": null,
195+
"ofType": {
196+
"kind": "SCALAR",
197+
"name": "String",
198+
"ofType": null
199+
}
200+
},
201+
"defaultValue": null
202+
},
203+
{
204+
"name": "email",
205+
"description": "User email",
206+
"type": {
207+
"kind": "NON_NULL",
208+
"name": null,
209+
"ofType": {
210+
"kind": "SCALAR",
211+
"name": "String",
212+
"ofType": null
213+
}
214+
},
215+
"defaultValue": null
216+
}
217+
],
218+
"interfaces": null,
219+
"enumValues": null,
220+
"possibleTypes": null
221+
},
222+
{
223+
"kind": "ENUM",
224+
"name": "UserStatus",
225+
"description": "User status enum",
226+
"fields": null,
227+
"inputFields": null,
228+
"interfaces": null,
229+
"enumValues": [
230+
{
231+
"name": "ACTIVE",
232+
"description": "User is active",
233+
"isDeprecated": false,
234+
"deprecationReason": null
235+
},
236+
{
237+
"name": "INACTIVE",
238+
"description": "User is inactive",
239+
"isDeprecated": false,
240+
"deprecationReason": null
241+
},
242+
{
243+
"name": "SUSPENDED",
244+
"description": "User is suspended",
245+
"isDeprecated": false,
246+
"deprecationReason": null
247+
}
248+
],
249+
"possibleTypes": null
250+
},
251+
{
252+
"kind": "SCALAR",
253+
"name": "ID",
254+
"description": "The `ID` scalar type represents a unique identifier",
255+
"fields": null,
256+
"inputFields": null,
257+
"interfaces": null,
258+
"enumValues": null,
259+
"possibleTypes": null
260+
},
261+
{
262+
"kind": "SCALAR",
263+
"name": "String",
264+
"description": "The `String` scalar type represents textual data",
265+
"fields": null,
266+
"inputFields": null,
267+
"interfaces": null,
268+
"enumValues": null,
269+
"possibleTypes": null
270+
}
271+
],
272+
"directives": []
273+
}
274+
}
275+
}

0 commit comments

Comments
 (0)