@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.
- package/CHANGELOG.md +27 -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 +17 -1
- package/dist/index.js +1334 -19871
- package/dist/index.js.map +1 -1
- package/dist/opendocs.graphql +56 -0
- package/package.json +7 -6
- 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/opendocs.graphql +56 -0
- package/src/opendocs.ts +253 -0
- package/src/schema.ts +253 -67
- package/src/types.ts +103 -0
- package/src/utils.ts +21 -96
- package/tsconfig.json +1 -1
- package/tsup.config.ts +15 -1
- package/vitest.config.ts +15 -1
- package/examples/basic/index.ts +0 -12
- package/examples/basic/schema.graphqls +0 -89
- package/examples/basic/todo-app.graphqls +0 -184
- package/examples/graphql-types/graphql-types.0.basic.graphqls +0 -28
- package/examples/nested/nested-arg.0.not-required.graphqls +0 -8
- package/examples/nested/nested-arg.0.required.graphqls +0 -8
- package/examples/nested/nested-arg.1.deep.graphqls +0 -12
- package/src/hydration/README.md +0 -1
- package/src/hydration/gql-arg.ts +0 -53
- package/src/hydration/gql-field.ts +0 -206
- package/src/hydration/gql-input.ts +0 -67
- package/src/hydration/gql-object.ts +0 -35
- package/src/hydration/gql-types.ts +0 -50
- package/src/samples/index.ts +0 -95
- package/test/graphql-types.0.test.ts +0 -125
- package/test/nested-arg.0.test.ts +0 -208
- package/test/nested-arg.1.test.ts +0 -19
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
extend schema @docs(
|
|
2
|
+
sort: [
|
|
3
|
+
{
|
|
4
|
+
node: "scalar",
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
node: "enum",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
node: "interface",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
node: "input",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
node: "object",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
node: "union",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
node: "query",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
node: "mutation",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
node: "subscription",
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# Custom scalar
|
|
34
|
+
scalar DateTime
|
|
35
|
+
|
|
36
|
+
# Enum
|
|
37
|
+
enum UserRole {
|
|
38
|
+
ADMIN
|
|
39
|
+
USER
|
|
40
|
+
GUEST
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
# Interface
|
|
44
|
+
interface Node {
|
|
45
|
+
id: ID!
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
# Input object
|
|
49
|
+
input UserInput {
|
|
50
|
+
name: String!
|
|
51
|
+
email: String!
|
|
52
|
+
role: UserRole
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
# Object
|
|
56
|
+
type User implements Node {
|
|
57
|
+
id: ID!
|
|
58
|
+
name: String!
|
|
59
|
+
email: String!
|
|
60
|
+
role: UserRole!
|
|
61
|
+
createdAt: DateTime!
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
# Union
|
|
65
|
+
union SearchResult = User | Post
|
|
66
|
+
|
|
67
|
+
type Post implements Node {
|
|
68
|
+
id: ID!
|
|
69
|
+
title: String!
|
|
70
|
+
content: String!
|
|
71
|
+
author: User!
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
# Query
|
|
75
|
+
type Query {
|
|
76
|
+
user(id: ID!): User
|
|
77
|
+
users: [User!]!
|
|
78
|
+
search(query: String!): [SearchResult!]!
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
# Mutation
|
|
82
|
+
type Mutation {
|
|
83
|
+
createUser(input: UserInput!): User!
|
|
84
|
+
updateUser(id: ID!, input: UserInput!): User!
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
# Subscription
|
|
88
|
+
type Subscription {
|
|
89
|
+
userCreated: User!
|
|
90
|
+
userUpdated: User!
|
|
91
|
+
}
|
|
92
|
+
|