-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathtest.graphql
More file actions
146 lines (122 loc) · 2.13 KB
/
test.graphql
File metadata and controls
146 lines (122 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
enum PageType {
LP
SERVICE
RESTRICTED
BASIC_AUTH
}
type Admin {
lastModifiedAt: Date
}
type Guest {
lastLoggedIn: Date
}
union UserKind = Admin | Guest
type User implements Namer {
id: ID
name: String
email: String
password: String
kind: UserKind
createdAt: Date
updatedAt: Date
}
interface Namer {
name: String
}
input PageInput {
id: ID!
title: String!
show: Boolean!
width: Int!
height: Float!
layout: LayoutInput!
tags: [String]
attributes: [AttributeInput!]
pageType: PageType!
date: Date
postIDs: [ID!]
}
input AttributeInput {
key: String
val: String
}
input LayoutInput {
dropdown: DropDownComponentInput
}
input DropDownComponentInput {
getEvent: EventInput!
dropdownComponent: ComponentInput
}
enum ButtonComponentType {
BUTTON
SUBMIT
}
input ComponentInput {
type: ButtonComponentType!
name: String!
event: EventInput
child: ComponentInput
childrens: [ComponentInput]
}
input EventInput {
arguments: [EventArgumentInput!]!
options: [EventOptionType!]
}
enum EventOptionType {
RETRY
RELOAD
}
input EventArgumentInput {
name: String! @constraint(minLength: 5)
value: String! @constraint(startsWith: "foo")
}
input HTTPInput {
method: HTTPMethod
url: URL!
}
enum HTTPMethod {
GET
POST
}
scalar Date
scalar URL
type MyType {
foo(a: String, b: Int!, c: Boolean, d: Float!): String
}
# https://github.com/confuser/graphql-constraint-directive
directive @constraint(
# String constraints
minLength: Int
maxLength: Int
startsWith: String
endsWith: String
contains: String
notContains: String
pattern: String
format: String
# Number constraints
min: Float
max: Float
exclusiveMin: Float
exclusiveMax: Float
multipleOf: Float
uniqueTypeName: String
) on INPUT_FIELD_DEFINITION | FIELD_DEFINITION
directive @oneOf on INPUT_OBJECT | FIELD_DEFINITION
type Comment {
replies: [Comment!]
}
# @oneOf examples - exactly one field must be provided
input SearchFilter @oneOf {
userId: ID
email: String
username: String
}
input MediaInput @oneOf {
url: URL
file: FileInput
}
input FileInput {
name: String!
size: Int!
}