@xyd-js/gql 0.1.0-build.170
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.
- package/CHANGELOG.md +1551 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/TODO.md +8 -0
- package/__fixtures__/-1.opendocs.docs-nested/input.graphql +66 -0
- package/__fixtures__/-1.opendocs.docs-nested/output.json +554 -0
- package/__fixtures__/-1.opendocs.flat/input.graphql +19 -0
- package/__fixtures__/-1.opendocs.flat/output.json +243 -0
- package/__fixtures__/-1.opendocs.scopes/input.graphql +33 -0
- package/__fixtures__/-1.opendocs.scopes/output.json +378 -0
- package/__fixtures__/-1.opendocs.sidebar/input.graphql +44 -0
- package/__fixtures__/-1.opendocs.sort/input.graphql +92 -0
- package/__fixtures__/-1.opendocs.sort/output.json +1078 -0
- package/__fixtures__/-1.opendocs.sort+group/input.graphql +111 -0
- package/__fixtures__/-1.opendocs.sort+group/output.json +1114 -0
- package/__fixtures__/-1.opendocs.sort+group+path/input.graphql +118 -0
- package/__fixtures__/-1.opendocs.sort+group+path/output.json +1114 -0
- package/__fixtures__/-2.complex.github/input.graphql +69424 -0
- package/__fixtures__/-2.complex.github/output.json +269874 -0
- package/__fixtures__/-2.complex.livesession/input.graphql +23 -0
- package/__fixtures__/-2.complex.livesession/output.json +302 -0
- package/__fixtures__/-2.complex.monday/input.graphql +6089 -0
- package/__fixtures__/-2.complex.monday/output.json +1 -0
- package/__fixtures__/-3.array-non-null-return/input.graphql +9 -0
- package/__fixtures__/-3.array-non-null-return/output.json +151 -0
- package/__fixtures__/1.basic/input.graphql +118 -0
- package/__fixtures__/1.basic/output.json +630 -0
- package/__fixtures__/2.circular/input.graphql +17 -0
- package/__fixtures__/2.circular/output.json +248 -0
- package/__fixtures__/3.opendocs/input.graphql +27 -0
- package/__fixtures__/3.opendocs/output.json +338 -0
- package/__fixtures__/4.union/input.graphql +19 -0
- package/__fixtures__/4.union/output.json +344 -0
- package/__fixtures__/5.flat/input.graphql +27 -0
- package/__fixtures__/5.flat/output.json +383 -0
- package/__fixtures__/6.default-values/input.graphql +47 -0
- package/__fixtures__/6.default-values/output.json +655 -0
- package/__fixtures__/7.type-args/input.graphql +19 -0
- package/__fixtures__/7.type-args/output.json +301 -0
- package/__fixtures__/8.default-sort/input.graphql +60 -0
- package/__fixtures__/8.default-sort/output.json +1078 -0
- package/__tests__/gqlSchemaToReferences.test.ts +109 -0
- package/__tests__/utils.ts +45 -0
- package/declarations.d.ts +4 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +1503 -0
- package/dist/index.js.map +1 -0
- package/dist/opendocs.graphql +56 -0
- package/index.ts +3 -0
- package/package.json +29 -0
- package/src/context.ts +17 -0
- package/src/converters/gql-arg.ts +51 -0
- package/src/converters/gql-enum.ts +27 -0
- package/src/converters/gql-field.ts +164 -0
- package/src/converters/gql-input.ts +34 -0
- package/src/converters/gql-interface.ts +35 -0
- package/src/converters/gql-mutation.ts +36 -0
- package/src/converters/gql-object.ts +83 -0
- package/src/converters/gql-operation.ts +128 -0
- package/src/converters/gql-query.ts +36 -0
- package/src/converters/gql-sample.ts +159 -0
- package/src/converters/gql-scalar.ts +16 -0
- package/src/converters/gql-subscription.ts +36 -0
- package/src/converters/gql-types.ts +195 -0
- package/src/converters/gql-union.ts +40 -0
- package/src/gql-core.ts +362 -0
- package/src/index.ts +3 -0
- package/src/opendocs.graphql +56 -0
- package/src/opendocs.ts +253 -0
- package/src/schema.ts +293 -0
- package/src/types.ts +103 -0
- package/src/utils.ts +25 -0
- package/tsconfig.json +18 -0
- package/tsup.config.ts +33 -0
- package/tsup.examples-config.ts +30 -0
- package/vitest.config.ts +21 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"title": "Book",
|
|
4
|
+
"description": "",
|
|
5
|
+
"canonical": "objects/Book",
|
|
6
|
+
"category": "graphql",
|
|
7
|
+
"type": "graphql_object",
|
|
8
|
+
"context": {
|
|
9
|
+
"graphqlTypeShort": "object",
|
|
10
|
+
"graphqlName": "Book",
|
|
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": "book_id",
|
|
36
|
+
"type": "ID!",
|
|
37
|
+
"description": "",
|
|
38
|
+
"context": {
|
|
39
|
+
"graphqlName": "book_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": "/book_id"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"meta": [
|
|
56
|
+
{
|
|
57
|
+
"name": "type",
|
|
58
|
+
"value": "fields"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"title": "books",
|
|
66
|
+
"description": "",
|
|
67
|
+
"canonical": "queries/books",
|
|
68
|
+
"category": "graphql",
|
|
69
|
+
"type": "graphql_query",
|
|
70
|
+
"context": {
|
|
71
|
+
"graphqlTypeShort": "query",
|
|
72
|
+
"graphqlName": "books",
|
|
73
|
+
"group": [
|
|
74
|
+
"Queries"
|
|
75
|
+
],
|
|
76
|
+
"scopes": []
|
|
77
|
+
},
|
|
78
|
+
"examples": {
|
|
79
|
+
"groups": [
|
|
80
|
+
{
|
|
81
|
+
"description": "",
|
|
82
|
+
"examples": [
|
|
83
|
+
{
|
|
84
|
+
"codeblock": {
|
|
85
|
+
"tabs": [
|
|
86
|
+
{
|
|
87
|
+
"title": "",
|
|
88
|
+
"language": "graphql",
|
|
89
|
+
"code": "query books($book_id: ID!) {\n books(book_id: $book_id) {\n # books fields\n }\n}"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"definitions": [
|
|
99
|
+
{
|
|
100
|
+
"title": "Arguments",
|
|
101
|
+
"properties": [
|
|
102
|
+
{
|
|
103
|
+
"name": "book_id",
|
|
104
|
+
"type": "ID!",
|
|
105
|
+
"description": "",
|
|
106
|
+
"context": {
|
|
107
|
+
"graphqlName": "book_id",
|
|
108
|
+
"graphqlTypeFlat": "ID",
|
|
109
|
+
"graphqlBuiltInType": true
|
|
110
|
+
},
|
|
111
|
+
"properties": [],
|
|
112
|
+
"meta": [
|
|
113
|
+
{
|
|
114
|
+
"name": "required",
|
|
115
|
+
"value": "true"
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"symbolDef": {
|
|
119
|
+
"canonical": "/book_id"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"title": "Returns",
|
|
126
|
+
"properties": [
|
|
127
|
+
{
|
|
128
|
+
"name": "",
|
|
129
|
+
"type": "[Book!]!",
|
|
130
|
+
"description": "",
|
|
131
|
+
"context": {
|
|
132
|
+
"graphqlName": "books",
|
|
133
|
+
"graphqlTypeFlat": "Book",
|
|
134
|
+
"graphqlBuiltInType": false
|
|
135
|
+
},
|
|
136
|
+
"properties": [],
|
|
137
|
+
"meta": [
|
|
138
|
+
{
|
|
139
|
+
"name": "required",
|
|
140
|
+
"value": "true"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"symbolDef": {
|
|
144
|
+
"canonical": "objects/Book"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
]
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"""
|
|
2
|
+
A book type
|
|
3
|
+
"""
|
|
4
|
+
type Book {
|
|
5
|
+
"""
|
|
6
|
+
The title of the book
|
|
7
|
+
"""
|
|
8
|
+
title: String!
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
The author of the book
|
|
12
|
+
"""
|
|
13
|
+
author_name: String!
|
|
14
|
+
|
|
15
|
+
"""
|
|
16
|
+
The nested book information
|
|
17
|
+
"""
|
|
18
|
+
info: BookInfo!
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
A book type
|
|
23
|
+
"""
|
|
24
|
+
type Book {
|
|
25
|
+
"""
|
|
26
|
+
The author of the book
|
|
27
|
+
"""
|
|
28
|
+
author_name: String!
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
"""
|
|
32
|
+
A book type
|
|
33
|
+
"""
|
|
34
|
+
type Book {
|
|
35
|
+
"""
|
|
36
|
+
The author of the book
|
|
37
|
+
"""
|
|
38
|
+
author_name: String!
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
"""
|
|
42
|
+
A nested book information type
|
|
43
|
+
"""
|
|
44
|
+
type BookInfo {
|
|
45
|
+
"""
|
|
46
|
+
The date of the book
|
|
47
|
+
"""
|
|
48
|
+
date: String!
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
"""
|
|
52
|
+
An author type
|
|
53
|
+
"""
|
|
54
|
+
type Author {
|
|
55
|
+
"""
|
|
56
|
+
The name of the author
|
|
57
|
+
"""
|
|
58
|
+
name: String!
|
|
59
|
+
|
|
60
|
+
"""
|
|
61
|
+
The books of the author
|
|
62
|
+
"""
|
|
63
|
+
books: [String]
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
"""
|
|
67
|
+
The input object for the getBook query
|
|
68
|
+
"""
|
|
69
|
+
input BookInput {
|
|
70
|
+
"""
|
|
71
|
+
The title of the book
|
|
72
|
+
"""
|
|
73
|
+
title: String!
|
|
74
|
+
|
|
75
|
+
"""
|
|
76
|
+
The author of the book
|
|
77
|
+
"""
|
|
78
|
+
info: BookInfoInput!
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
"""
|
|
82
|
+
A nested book information input
|
|
83
|
+
"""
|
|
84
|
+
input BookInfoInput {
|
|
85
|
+
"""
|
|
86
|
+
The date of the book
|
|
87
|
+
"""
|
|
88
|
+
date: String!
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
type Query {
|
|
92
|
+
"""
|
|
93
|
+
Get a book by title
|
|
94
|
+
"""
|
|
95
|
+
getBookByTitle(
|
|
96
|
+
"""
|
|
97
|
+
The title of the book
|
|
98
|
+
"""
|
|
99
|
+
title: String!
|
|
100
|
+
|
|
101
|
+
"""
|
|
102
|
+
The book info input
|
|
103
|
+
"""
|
|
104
|
+
info: BookInfoInput
|
|
105
|
+
): Book
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
type Mutation {
|
|
109
|
+
"""
|
|
110
|
+
Add a book
|
|
111
|
+
"""
|
|
112
|
+
addBook(input: BookInput!): Book!
|
|
113
|
+
|
|
114
|
+
"""
|
|
115
|
+
Add an author
|
|
116
|
+
"""
|
|
117
|
+
addAuthor(name: String!): Author!
|
|
118
|
+
}
|