-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathcustom-query.graphql
174 lines (143 loc) · 2.62 KB
/
custom-query.graphql
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#######################
# Input Schema
#######################
type User {
id: ID!
name: String!
}
#######################
# Extended Definitions
#######################
scalar DateTime
enum DgraphIndex {
int
float
bool
hash
exact
term
fulltext
trigram
regexp
year
month
day
hour
}
input CustomHTTP {
url: String!
method: String!
}
directive @hasInverse(field: String!) on FIELD_DEFINITION
directive @search(by: [DgraphIndex!]) on FIELD_DEFINITION
directive @dgraph(type: String, pred: String) on OBJECT | INTERFACE | FIELD_DEFINITION
directive @id on FIELD_DEFINITION
directive @secret(field: String!, pred: String) on OBJECT | INTERFACE
directive @custom(http: CustomHTTP) on FIELD_DEFINITION
directive @not_dgraph on OBJECT
input IntFilter {
eq: Int
le: Int
lt: Int
ge: Int
gt: Int
}
input FloatFilter {
eq: Float
le: Float
lt: Float
ge: Float
gt: Float
}
input DateTimeFilter {
eq: DateTime
le: DateTime
lt: DateTime
ge: DateTime
gt: DateTime
}
input StringTermFilter {
allofterms: String
anyofterms: String
}
input StringRegExpFilter {
regexp: String
}
input StringFullTextFilter {
alloftext: String
anyoftext: String
}
input StringExactFilter {
eq: String
le: String
lt: String
ge: String
gt: String
}
input StringHashFilter {
eq: String
}
#######################
# Generated Types
#######################
type AddUserPayload {
user(filter: UserFilter, order: UserOrder, first: Int, offset: Int): [User]
numUids: Int
}
type DeleteUserPayload {
msg: String
numUids: Int
}
type UpdateUserPayload {
user(filter: UserFilter, order: UserOrder, first: Int, offset: Int): [User]
numUids: Int
}
#######################
# Generated Enums
#######################
enum UserOrderable {
name
}
#######################
# Generated Inputs
#######################
input AddUserInput {
name: String!
}
input UpdateUserInput {
filter: UserFilter!
set: UserPatch
remove: UserPatch
}
input UserFilter {
id: [ID!]
not: UserFilter
}
input UserOrder {
asc: UserOrderable
desc: UserOrderable
then: UserOrder
}
input UserPatch {
name: String
}
input UserRef {
id: ID
name: String
}
#######################
# Generated Query
#######################
type Query {
getMyFavoriteUsers(id: ID!): [User] @custom(http: {url:"http://my-api.com",method:"GET"})
getUser(id: ID!): User
queryUser(filter: UserFilter, order: UserOrder, first: Int, offset: Int): [User]
}
#######################
# Generated Mutations
#######################
type Mutation {
addUser(input: [AddUserInput!]!): AddUserPayload
updateUser(input: UpdateUserInput!): UpdateUserPayload
deleteUser(filter: UserFilter!): DeleteUserPayload
}