@xyd-js/gql 0.1.0-xyd.4 → 0.1.0-xyd.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/CHANGELOG.md +459 -0
  2. package/LICENSE +21 -0
  3. package/TODO.md +8 -0
  4. package/__fixtures__/-1.opendocs.docs-nested/input.graphql +66 -0
  5. package/__fixtures__/-1.opendocs.docs-nested/output.json +554 -0
  6. package/__fixtures__/-1.opendocs.flat/input.graphql +19 -0
  7. package/__fixtures__/-1.opendocs.flat/output.json +243 -0
  8. package/__fixtures__/-1.opendocs.scopes/input.graphql +33 -0
  9. package/__fixtures__/-1.opendocs.scopes/output.json +378 -0
  10. package/__fixtures__/-1.opendocs.sidebar/input.graphql +44 -0
  11. package/__fixtures__/-1.opendocs.sort/input.graphql +92 -0
  12. package/__fixtures__/-1.opendocs.sort/output.json +1078 -0
  13. package/__fixtures__/-1.opendocs.sort+group/input.graphql +111 -0
  14. package/__fixtures__/-1.opendocs.sort+group/output.json +1114 -0
  15. package/__fixtures__/-1.opendocs.sort+group+path/input.graphql +118 -0
  16. package/__fixtures__/-1.opendocs.sort+group+path/output.json +1114 -0
  17. package/__fixtures__/-2.complex.github/input.graphql +69424 -0
  18. package/__fixtures__/-2.complex.github/output.json +269874 -0
  19. package/__fixtures__/-2.complex.livesession/input.graphql +23 -0
  20. package/__fixtures__/-2.complex.livesession/output.json +302 -0
  21. package/__fixtures__/-2.complex.monday/input.graphql +6089 -0
  22. package/__fixtures__/-2.complex.monday/output.json +1 -0
  23. package/__fixtures__/-3.array-non-null-return/input.graphql +9 -0
  24. package/__fixtures__/-3.array-non-null-return/output.json +151 -0
  25. package/__fixtures__/1.basic/input.graphql +118 -0
  26. package/__fixtures__/1.basic/output.json +630 -0
  27. package/__fixtures__/2.circular/input.graphql +17 -0
  28. package/__fixtures__/2.circular/output.json +248 -0
  29. package/__fixtures__/3.opendocs/input.graphql +27 -0
  30. package/__fixtures__/3.opendocs/output.json +338 -0
  31. package/__fixtures__/4.union/input.graphql +19 -0
  32. package/__fixtures__/4.union/output.json +344 -0
  33. package/__fixtures__/5.flat/input.graphql +27 -0
  34. package/__fixtures__/5.flat/output.json +383 -0
  35. package/__fixtures__/6.default-values/input.graphql +47 -0
  36. package/__fixtures__/6.default-values/output.json +655 -0
  37. package/__fixtures__/7.type-args/input.graphql +19 -0
  38. package/__fixtures__/7.type-args/output.json +301 -0
  39. package/__fixtures__/8.default-sort/input.graphql +60 -0
  40. package/__fixtures__/8.default-sort/output.json +1078 -0
  41. package/__tests__/gqlSchemaToReferences.test.ts +109 -0
  42. package/__tests__/utils.ts +45 -0
  43. package/declarations.d.ts +4 -0
  44. package/dist/index.d.ts +17 -1
  45. package/dist/index.js +1334 -19871
  46. package/dist/index.js.map +1 -1
  47. package/dist/opendocs.graphql +56 -0
  48. package/package.json +7 -9
  49. package/src/context.ts +17 -0
  50. package/src/converters/gql-arg.ts +51 -0
  51. package/src/converters/gql-enum.ts +27 -0
  52. package/src/converters/gql-field.ts +164 -0
  53. package/src/converters/gql-input.ts +34 -0
  54. package/src/converters/gql-interface.ts +35 -0
  55. package/src/converters/gql-mutation.ts +36 -0
  56. package/src/converters/gql-object.ts +83 -0
  57. package/src/converters/gql-operation.ts +128 -0
  58. package/src/converters/gql-query.ts +36 -0
  59. package/src/converters/gql-sample.ts +159 -0
  60. package/src/converters/gql-scalar.ts +16 -0
  61. package/src/converters/gql-subscription.ts +36 -0
  62. package/src/converters/gql-types.ts +195 -0
  63. package/src/converters/gql-union.ts +40 -0
  64. package/src/gql-core.ts +362 -0
  65. package/src/opendocs.graphql +56 -0
  66. package/src/opendocs.ts +253 -0
  67. package/src/schema.ts +253 -67
  68. package/src/types.ts +103 -0
  69. package/src/utils.ts +21 -96
  70. package/tsconfig.json +1 -1
  71. package/tsup.config.ts +15 -1
  72. package/vitest.config.ts +15 -1
  73. package/examples/basic/index.ts +0 -12
  74. package/examples/basic/schema.graphqls +0 -89
  75. package/examples/basic/todo-app.graphqls +0 -184
  76. package/examples/graphql-types/graphql-types.0.basic.graphqls +0 -28
  77. package/examples/nested/nested-arg.0.not-required.graphqls +0 -8
  78. package/examples/nested/nested-arg.0.required.graphqls +0 -8
  79. package/examples/nested/nested-arg.1.deep.graphqls +0 -12
  80. package/src/hydration/README.md +0 -1
  81. package/src/hydration/gql-arg.ts +0 -53
  82. package/src/hydration/gql-field.ts +0 -206
  83. package/src/hydration/gql-input.ts +0 -67
  84. package/src/hydration/gql-object.ts +0 -35
  85. package/src/hydration/gql-types.ts +0 -50
  86. package/src/samples/index.ts +0 -95
  87. package/test/graphql-types.0.test.ts +0 -125
  88. package/test/nested-arg.0.test.ts +0 -208
  89. package/test/nested-arg.1.test.ts +0 -19
@@ -0,0 +1,344 @@
1
+ [
2
+ {
3
+ "title": "Discount",
4
+ "description": "",
5
+ "canonical": "objects/Discount",
6
+ "category": "graphql",
7
+ "type": "graphql_object",
8
+ "context": {
9
+ "graphqlTypeShort": "object",
10
+ "graphqlName": "Discount",
11
+ "group": [
12
+ "Objects"
13
+ ],
14
+ "scopes": []
15
+ },
16
+ "examples": {
17
+ "groups": []
18
+ },
19
+ "definitions": [
20
+ {
21
+ "title": "Arguments",
22
+ "properties": [],
23
+ "variants": [],
24
+ "meta": [
25
+ {
26
+ "name": "type",
27
+ "value": "arguments"
28
+ }
29
+ ]
30
+ },
31
+ {
32
+ "title": "Fields",
33
+ "properties": [
34
+ {
35
+ "name": "id",
36
+ "type": "ID!",
37
+ "description": "",
38
+ "context": {
39
+ "graphqlName": "id",
40
+ "graphqlTypeFlat": "ID",
41
+ "graphqlBuiltInType": true
42
+ },
43
+ "properties": [],
44
+ "meta": [
45
+ {
46
+ "name": "required",
47
+ "value": "true"
48
+ }
49
+ ],
50
+ "symbolDef": {
51
+ "canonical": "/id"
52
+ }
53
+ }
54
+ ],
55
+ "meta": [
56
+ {
57
+ "name": "type",
58
+ "value": "fields"
59
+ }
60
+ ]
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "title": "Coupon",
66
+ "description": "",
67
+ "canonical": "objects/Coupon",
68
+ "category": "graphql",
69
+ "type": "graphql_object",
70
+ "context": {
71
+ "graphqlTypeShort": "object",
72
+ "graphqlName": "Coupon",
73
+ "group": [
74
+ "Objects"
75
+ ],
76
+ "scopes": []
77
+ },
78
+ "examples": {
79
+ "groups": []
80
+ },
81
+ "definitions": [
82
+ {
83
+ "title": "Arguments",
84
+ "properties": [],
85
+ "variants": [],
86
+ "meta": [
87
+ {
88
+ "name": "type",
89
+ "value": "arguments"
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ "title": "Fields",
95
+ "properties": [
96
+ {
97
+ "name": "id",
98
+ "type": "ID!",
99
+ "description": "",
100
+ "context": {
101
+ "graphqlName": "id",
102
+ "graphqlTypeFlat": "ID",
103
+ "graphqlBuiltInType": true
104
+ },
105
+ "properties": [],
106
+ "meta": [
107
+ {
108
+ "name": "required",
109
+ "value": "true"
110
+ }
111
+ ],
112
+ "symbolDef": {
113
+ "canonical": "/id"
114
+ }
115
+ }
116
+ ],
117
+ "meta": [
118
+ {
119
+ "name": "type",
120
+ "value": "fields"
121
+ }
122
+ ]
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ "title": "Refund",
128
+ "description": "",
129
+ "canonical": "objects/Refund",
130
+ "category": "graphql",
131
+ "type": "graphql_object",
132
+ "context": {
133
+ "graphqlTypeShort": "object",
134
+ "graphqlName": "Refund",
135
+ "group": [
136
+ "Objects"
137
+ ],
138
+ "scopes": []
139
+ },
140
+ "examples": {
141
+ "groups": []
142
+ },
143
+ "definitions": [
144
+ {
145
+ "title": "Arguments",
146
+ "properties": [],
147
+ "variants": [],
148
+ "meta": [
149
+ {
150
+ "name": "type",
151
+ "value": "arguments"
152
+ }
153
+ ]
154
+ },
155
+ {
156
+ "title": "Fields",
157
+ "properties": [
158
+ {
159
+ "name": "id",
160
+ "type": "ID!",
161
+ "description": "",
162
+ "context": {
163
+ "graphqlName": "id",
164
+ "graphqlTypeFlat": "ID",
165
+ "graphqlBuiltInType": true
166
+ },
167
+ "properties": [],
168
+ "meta": [
169
+ {
170
+ "name": "required",
171
+ "value": "true"
172
+ }
173
+ ],
174
+ "symbolDef": {
175
+ "canonical": "/id"
176
+ }
177
+ }
178
+ ],
179
+ "meta": [
180
+ {
181
+ "name": "type",
182
+ "value": "fields"
183
+ }
184
+ ]
185
+ }
186
+ ]
187
+ },
188
+ {
189
+ "title": "Order",
190
+ "description": "",
191
+ "canonical": "objects/Order",
192
+ "category": "graphql",
193
+ "type": "graphql_object",
194
+ "context": {
195
+ "graphqlTypeShort": "object",
196
+ "graphqlName": "Order",
197
+ "group": [
198
+ "Objects"
199
+ ],
200
+ "scopes": []
201
+ },
202
+ "examples": {
203
+ "groups": []
204
+ },
205
+ "definitions": [
206
+ {
207
+ "title": "Arguments",
208
+ "properties": [],
209
+ "variants": [],
210
+ "meta": [
211
+ {
212
+ "name": "type",
213
+ "value": "arguments"
214
+ }
215
+ ]
216
+ },
217
+ {
218
+ "title": "Fields",
219
+ "properties": [
220
+ {
221
+ "name": "id",
222
+ "type": "ID!",
223
+ "description": "",
224
+ "context": {
225
+ "graphqlName": "id",
226
+ "graphqlTypeFlat": "ID",
227
+ "graphqlBuiltInType": true
228
+ },
229
+ "properties": [],
230
+ "meta": [
231
+ {
232
+ "name": "required",
233
+ "value": "true"
234
+ }
235
+ ],
236
+ "symbolDef": {
237
+ "canonical": "/id"
238
+ }
239
+ },
240
+ {
241
+ "name": "offer",
242
+ "type": "Offer",
243
+ "description": "",
244
+ "context": {
245
+ "graphqlName": "offer",
246
+ "graphqlTypeFlat": "Offer",
247
+ "graphqlBuiltInType": false
248
+ },
249
+ "properties": [],
250
+ "meta": [],
251
+ "symbolDef": {
252
+ "canonical": "unions/Offer"
253
+ }
254
+ }
255
+ ],
256
+ "meta": [
257
+ {
258
+ "name": "type",
259
+ "value": "fields"
260
+ }
261
+ ]
262
+ }
263
+ ]
264
+ },
265
+ {
266
+ "title": "Offer",
267
+ "description": "",
268
+ "canonical": "unions/Offer",
269
+ "category": "graphql",
270
+ "type": "graphql_union",
271
+ "context": {
272
+ "graphqlTypeShort": "union",
273
+ "graphqlName": "Offer",
274
+ "group": [
275
+ "Unions"
276
+ ],
277
+ "scopes": []
278
+ },
279
+ "examples": {
280
+ "groups": []
281
+ },
282
+ "definitions": [
283
+ {
284
+ "title": "Possible types",
285
+ "properties": [
286
+ {
287
+ "name": "Discount",
288
+ "type": "Discount",
289
+ "description": "",
290
+ "context": {
291
+ "graphqlTypeShort": "object",
292
+ "graphqlName": "Discount",
293
+ "group": [
294
+ "Objects"
295
+ ],
296
+ "scopes": []
297
+ },
298
+ "properties": [],
299
+ "meta": [],
300
+ "symbolDef": {
301
+ "canonical": "objects/Discount"
302
+ }
303
+ },
304
+ {
305
+ "name": "Coupon",
306
+ "type": "Coupon",
307
+ "description": "",
308
+ "context": {
309
+ "graphqlTypeShort": "object",
310
+ "graphqlName": "Coupon",
311
+ "group": [
312
+ "Objects"
313
+ ],
314
+ "scopes": []
315
+ },
316
+ "properties": [],
317
+ "meta": [],
318
+ "symbolDef": {
319
+ "canonical": "objects/Coupon"
320
+ }
321
+ },
322
+ {
323
+ "name": "Refund",
324
+ "type": "Refund",
325
+ "description": "",
326
+ "context": {
327
+ "graphqlTypeShort": "object",
328
+ "graphqlName": "Refund",
329
+ "group": [
330
+ "Objects"
331
+ ],
332
+ "scopes": []
333
+ },
334
+ "properties": [],
335
+ "meta": [],
336
+ "symbolDef": {
337
+ "canonical": "objects/Refund"
338
+ }
339
+ }
340
+ ]
341
+ }
342
+ ]
343
+ }
344
+ ]
@@ -0,0 +1,27 @@
1
+ type Author {
2
+ id: ID!
3
+
4
+ name: String!
5
+
6
+ details: AuthorDetails!
7
+ }
8
+
9
+ type AuthorDetails {
10
+ birthDate: String
11
+ }
12
+
13
+ input AuthorDetailsInput {
14
+ birthDate: String
15
+ }
16
+
17
+ type Query {
18
+ author(
19
+ id: ID!
20
+ details: AuthorDetailsInput
21
+ ): Author
22
+
23
+ authorDelete(
24
+ id: ID!
25
+ ): Boolean
26
+ }
27
+