@xyd-js/gql 0.1.0-xyd.12 → 0.1.0-xyd.15

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 (88) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/TODO.md +8 -0
  3. package/__fixtures__/-1.opendocs.docs-nested/input.graphql +66 -0
  4. package/__fixtures__/-1.opendocs.docs-nested/output.json +554 -0
  5. package/__fixtures__/-1.opendocs.flat/input.graphql +19 -0
  6. package/__fixtures__/-1.opendocs.flat/output.json +243 -0
  7. package/__fixtures__/-1.opendocs.scopes/input.graphql +33 -0
  8. package/__fixtures__/-1.opendocs.scopes/output.json +378 -0
  9. package/__fixtures__/-1.opendocs.sidebar/input.graphql +44 -0
  10. package/__fixtures__/-1.opendocs.sort/input.graphql +92 -0
  11. package/__fixtures__/-1.opendocs.sort/output.json +1078 -0
  12. package/__fixtures__/-1.opendocs.sort+group/input.graphql +111 -0
  13. package/__fixtures__/-1.opendocs.sort+group/output.json +1114 -0
  14. package/__fixtures__/-1.opendocs.sort+group+path/input.graphql +118 -0
  15. package/__fixtures__/-1.opendocs.sort+group+path/output.json +1114 -0
  16. package/__fixtures__/-2.complex.github/input.graphql +69424 -0
  17. package/__fixtures__/-2.complex.github/output.json +269874 -0
  18. package/__fixtures__/-2.complex.livesession/input.graphql +23 -0
  19. package/__fixtures__/-2.complex.livesession/output.json +302 -0
  20. package/__fixtures__/-2.complex.monday/input.graphql +6089 -0
  21. package/__fixtures__/-2.complex.monday/output.json +1 -0
  22. package/__fixtures__/-3.array-non-null-return/input.graphql +9 -0
  23. package/__fixtures__/-3.array-non-null-return/output.json +151 -0
  24. package/__fixtures__/1.basic/input.graphql +118 -0
  25. package/__fixtures__/1.basic/output.json +630 -0
  26. package/__fixtures__/2.circular/input.graphql +17 -0
  27. package/__fixtures__/2.circular/output.json +248 -0
  28. package/__fixtures__/3.opendocs/input.graphql +27 -0
  29. package/__fixtures__/3.opendocs/output.json +338 -0
  30. package/__fixtures__/4.union/input.graphql +19 -0
  31. package/__fixtures__/4.union/output.json +344 -0
  32. package/__fixtures__/5.flat/input.graphql +27 -0
  33. package/__fixtures__/5.flat/output.json +383 -0
  34. package/__fixtures__/6.default-values/input.graphql +47 -0
  35. package/__fixtures__/6.default-values/output.json +655 -0
  36. package/__fixtures__/7.type-args/input.graphql +19 -0
  37. package/__fixtures__/7.type-args/output.json +301 -0
  38. package/__fixtures__/8.default-sort/input.graphql +60 -0
  39. package/__fixtures__/8.default-sort/output.json +1078 -0
  40. package/__tests__/gqlSchemaToReferences.test.ts +109 -0
  41. package/__tests__/utils.ts +45 -0
  42. package/declarations.d.ts +4 -0
  43. package/dist/index.d.ts +17 -1
  44. package/dist/index.js +1334 -19871
  45. package/dist/index.js.map +1 -1
  46. package/dist/opendocs.graphql +56 -0
  47. package/package.json +7 -6
  48. package/src/context.ts +17 -0
  49. package/src/converters/gql-arg.ts +51 -0
  50. package/src/converters/gql-enum.ts +27 -0
  51. package/src/converters/gql-field.ts +164 -0
  52. package/src/converters/gql-input.ts +34 -0
  53. package/src/converters/gql-interface.ts +35 -0
  54. package/src/converters/gql-mutation.ts +36 -0
  55. package/src/converters/gql-object.ts +83 -0
  56. package/src/converters/gql-operation.ts +128 -0
  57. package/src/converters/gql-query.ts +36 -0
  58. package/src/converters/gql-sample.ts +159 -0
  59. package/src/converters/gql-scalar.ts +16 -0
  60. package/src/converters/gql-subscription.ts +36 -0
  61. package/src/converters/gql-types.ts +195 -0
  62. package/src/converters/gql-union.ts +40 -0
  63. package/src/gql-core.ts +362 -0
  64. package/src/opendocs.graphql +56 -0
  65. package/src/opendocs.ts +253 -0
  66. package/src/schema.ts +253 -67
  67. package/src/types.ts +103 -0
  68. package/src/utils.ts +21 -96
  69. package/tsconfig.json +1 -1
  70. package/tsup.config.ts +15 -1
  71. package/vitest.config.ts +15 -1
  72. package/examples/basic/index.ts +0 -12
  73. package/examples/basic/schema.graphqls +0 -89
  74. package/examples/basic/todo-app.graphqls +0 -184
  75. package/examples/graphql-types/graphql-types.0.basic.graphqls +0 -28
  76. package/examples/nested/nested-arg.0.not-required.graphqls +0 -8
  77. package/examples/nested/nested-arg.0.required.graphqls +0 -8
  78. package/examples/nested/nested-arg.1.deep.graphqls +0 -12
  79. package/src/hydration/README.md +0 -1
  80. package/src/hydration/gql-arg.ts +0 -53
  81. package/src/hydration/gql-field.ts +0 -206
  82. package/src/hydration/gql-input.ts +0 -67
  83. package/src/hydration/gql-object.ts +0 -35
  84. package/src/hydration/gql-types.ts +0 -50
  85. package/src/samples/index.ts +0 -95
  86. package/test/graphql-types.0.test.ts +0 -125
  87. package/test/nested-arg.0.test.ts +0 -208
  88. package/test/nested-arg.1.test.ts +0 -19
@@ -0,0 +1,23 @@
1
+ extend schema @docs(
2
+ flattenTypes: true
3
+ )
4
+
5
+ input BookCreateDetailsInput {
6
+ date: String
7
+ }
8
+
9
+ input BookCreateInput {
10
+ title: String!
11
+
12
+ details: BookCreateDetailsInput!
13
+ }
14
+
15
+ type Book {
16
+ id: ID!
17
+
18
+ title: String!
19
+ }
20
+
21
+ type Mutation {
22
+ bookCreate(input: BookCreateInput!): Book!
23
+ }
@@ -0,0 +1,302 @@
1
+ [
2
+ {
3
+ "title": "bookCreate",
4
+ "description": "",
5
+ "canonical": "mutations/bookcreate",
6
+ "category": "graphql",
7
+ "type": "graphql_mutation",
8
+ "context": {
9
+ "graphqlTypeShort": "mutation",
10
+ "graphqlName": "bookCreate",
11
+ "group": [
12
+ "Mutations"
13
+ ]
14
+ },
15
+ "examples": {
16
+ "groups": [
17
+ {
18
+ "description": "Example request",
19
+ "examples": [
20
+ {
21
+ "codeblock": {
22
+ "tabs": [
23
+ {
24
+ "title": "Mutation reference",
25
+ "language": "graphql",
26
+ "code": "mutation bookCreate($input: BookCreateInput!) {\n bookCreate(input: $input) {\n # bookCreate fields\n }\n}"
27
+ }
28
+ ]
29
+ }
30
+ }
31
+ ]
32
+ }
33
+ ]
34
+ },
35
+ "definitions": [
36
+ {
37
+ "title": "Arguments",
38
+ "properties": [
39
+ {
40
+ "name": "input",
41
+ "type": "BookCreateInput!",
42
+ "description": "",
43
+ "context": {
44
+ "graphqlTypeShort": "input",
45
+ "graphqlName": "BookCreateInput",
46
+ "group": [
47
+ "Inputs"
48
+ ]
49
+ },
50
+ "properties": [
51
+ {
52
+ "name": "title",
53
+ "type": "String!",
54
+ "description": "",
55
+ "context": {
56
+ "graphqlName": "title",
57
+ "graphqlTypeFlat": "String",
58
+ "graphqlBuiltInType": true
59
+ },
60
+ "properties": [],
61
+ "meta": [
62
+ {
63
+ "name": "required",
64
+ "value": "true"
65
+ }
66
+ ],
67
+ "typeDef": {
68
+ "symbolId": ""
69
+ }
70
+ },
71
+ {
72
+ "name": "details",
73
+ "type": "BookCreateDetailsInput!",
74
+ "description": "",
75
+ "context": {
76
+ "graphqlName": "details",
77
+ "graphqlTypeFlat": "BookCreateDetailsInput",
78
+ "graphqlBuiltInType": false
79
+ },
80
+ "properties": [],
81
+ "meta": [
82
+ {
83
+ "name": "required",
84
+ "value": "true"
85
+ }
86
+ ],
87
+ "typeDef": {
88
+ "symbolId": "inputs/bookcreatedetailsinput"
89
+ }
90
+ }
91
+ ],
92
+ "meta": [
93
+ {
94
+ "name": "required",
95
+ "value": "true"
96
+ }
97
+ ],
98
+ "typeDef": {
99
+ "symbolId": "inputs/bookcreateinput"
100
+ }
101
+ }
102
+ ]
103
+ },
104
+ {
105
+ "title": "Returns",
106
+ "properties": [
107
+ {
108
+ "name": "bookCreate",
109
+ "type": "Book!",
110
+ "description": "",
111
+ "context": {
112
+ "graphqlName": "bookCreate",
113
+ "graphqlTypeFlat": "Book",
114
+ "graphqlBuiltInType": false
115
+ },
116
+ "properties": [],
117
+ "meta": [
118
+ {
119
+ "name": "required",
120
+ "value": "true"
121
+ },
122
+ {
123
+ "name": "flat",
124
+ "value": "true"
125
+ }
126
+ ],
127
+ "typeDef": {
128
+ "symbolId": "objects/book"
129
+ }
130
+ }
131
+ ]
132
+ }
133
+ ]
134
+ },
135
+ {
136
+ "title": "Book",
137
+ "description": "",
138
+ "canonical": "objects/book",
139
+ "category": "graphql",
140
+ "type": "graphql_object",
141
+ "context": {
142
+ "graphqlTypeShort": "object",
143
+ "graphqlName": "Book",
144
+ "group": [
145
+ "Objects"
146
+ ]
147
+ },
148
+ "examples": {
149
+ "groups": []
150
+ },
151
+ "definitions": [
152
+ {
153
+ "title": "Fields",
154
+ "properties": [
155
+ {
156
+ "name": "id",
157
+ "type": "ID!",
158
+ "description": "",
159
+ "context": {
160
+ "graphqlName": "id",
161
+ "graphqlTypeFlat": "ID",
162
+ "graphqlBuiltInType": true
163
+ },
164
+ "properties": [],
165
+ "meta": [
166
+ {
167
+ "name": "required",
168
+ "value": "true"
169
+ }
170
+ ],
171
+ "typeDef": {
172
+ "symbolId": ""
173
+ }
174
+ },
175
+ {
176
+ "name": "title",
177
+ "type": "String!",
178
+ "description": "",
179
+ "context": {
180
+ "graphqlName": "title",
181
+ "graphqlTypeFlat": "String",
182
+ "graphqlBuiltInType": true
183
+ },
184
+ "properties": [],
185
+ "meta": [
186
+ {
187
+ "name": "required",
188
+ "value": "true"
189
+ }
190
+ ],
191
+ "typeDef": {
192
+ "symbolId": ""
193
+ }
194
+ }
195
+ ]
196
+ }
197
+ ]
198
+ },
199
+ {
200
+ "title": "BookCreateDetailsInput",
201
+ "description": "",
202
+ "canonical": "inputs/bookcreatedetailsinput",
203
+ "category": "graphql",
204
+ "type": "graphql_input",
205
+ "context": {
206
+ "graphqlTypeShort": "input",
207
+ "graphqlName": "BookCreateDetailsInput",
208
+ "group": [
209
+ "Inputs"
210
+ ]
211
+ },
212
+ "examples": {
213
+ "groups": []
214
+ },
215
+ "definitions": [
216
+ {
217
+ "title": "Fields",
218
+ "properties": [
219
+ {
220
+ "name": "date",
221
+ "type": "String",
222
+ "description": "",
223
+ "context": {
224
+ "graphqlName": "date",
225
+ "graphqlTypeFlat": "String",
226
+ "graphqlBuiltInType": true
227
+ },
228
+ "properties": [],
229
+ "meta": [],
230
+ "typeDef": {
231
+ "symbolId": ""
232
+ }
233
+ }
234
+ ]
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ "title": "BookCreateInput",
240
+ "description": "",
241
+ "canonical": "inputs/bookcreateinput",
242
+ "category": "graphql",
243
+ "type": "graphql_input",
244
+ "context": {
245
+ "graphqlTypeShort": "input",
246
+ "graphqlName": "BookCreateInput",
247
+ "group": [
248
+ "Inputs"
249
+ ]
250
+ },
251
+ "examples": {
252
+ "groups": []
253
+ },
254
+ "definitions": [
255
+ {
256
+ "title": "Fields",
257
+ "properties": [
258
+ {
259
+ "name": "title",
260
+ "type": "String!",
261
+ "description": "",
262
+ "context": {
263
+ "graphqlName": "title",
264
+ "graphqlTypeFlat": "String",
265
+ "graphqlBuiltInType": true
266
+ },
267
+ "properties": [],
268
+ "meta": [
269
+ {
270
+ "name": "required",
271
+ "value": "true"
272
+ }
273
+ ],
274
+ "typeDef": {
275
+ "symbolId": ""
276
+ }
277
+ },
278
+ {
279
+ "name": "details",
280
+ "type": "BookCreateDetailsInput!",
281
+ "description": "",
282
+ "context": {
283
+ "graphqlName": "details",
284
+ "graphqlTypeFlat": "BookCreateDetailsInput",
285
+ "graphqlBuiltInType": false
286
+ },
287
+ "properties": [],
288
+ "meta": [
289
+ {
290
+ "name": "required",
291
+ "value": "true"
292
+ }
293
+ ],
294
+ "typeDef": {
295
+ "symbolId": "inputs/bookcreatedetailsinput"
296
+ }
297
+ }
298
+ ]
299
+ }
300
+ ]
301
+ }
302
+ ]