Skip to content

Commit ec1e0bf

Browse files
committed
Fix typeDefs
1 parent cc696bc commit ec1e0bf

File tree

3 files changed

+325
-2
lines changed

3 files changed

+325
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
"devDependencies": {
2525
"graphql-cli": "^2.16.5",
2626
"prisma": "^1.14.2"
27-
}
27+
}
2828
}

src/generated/prisma.graphql

+323
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,323 @@
1+
# source: http://localhost:4466
2+
# timestamp: Sat Aug 25 2018 16:42:56 GMT+0900 (Japan Standard Time)
3+
4+
type AggregateLink {
5+
count: Int!
6+
}
7+
8+
type BatchPayload {
9+
"""The number of nodes that have been affected by the Batch operation."""
10+
count: Long!
11+
}
12+
13+
scalar DateTime
14+
15+
type Link implements Node {
16+
id: ID!
17+
createdAt: DateTime!
18+
description: String!
19+
url: String!
20+
}
21+
22+
"""A connection to a list of items."""
23+
type LinkConnection {
24+
"""Information to aid in pagination."""
25+
pageInfo: PageInfo!
26+
27+
"""A list of edges."""
28+
edges: [LinkEdge]!
29+
aggregate: AggregateLink!
30+
}
31+
32+
input LinkCreateInput {
33+
description: String!
34+
url: String!
35+
}
36+
37+
"""An edge in a connection."""
38+
type LinkEdge {
39+
"""The item at the end of the edge."""
40+
node: Link!
41+
42+
"""A cursor for use in pagination."""
43+
cursor: String!
44+
}
45+
46+
enum LinkOrderByInput {
47+
id_ASC
48+
id_DESC
49+
createdAt_ASC
50+
createdAt_DESC
51+
description_ASC
52+
description_DESC
53+
url_ASC
54+
url_DESC
55+
updatedAt_ASC
56+
updatedAt_DESC
57+
}
58+
59+
type LinkPreviousValues {
60+
id: ID!
61+
createdAt: DateTime!
62+
description: String!
63+
url: String!
64+
}
65+
66+
type LinkSubscriptionPayload {
67+
mutation: MutationType!
68+
node: Link
69+
updatedFields: [String!]
70+
previousValues: LinkPreviousValues
71+
}
72+
73+
input LinkSubscriptionWhereInput {
74+
"""Logical AND on all given filters."""
75+
AND: [LinkSubscriptionWhereInput!]
76+
77+
"""Logical OR on all given filters."""
78+
OR: [LinkSubscriptionWhereInput!]
79+
80+
"""Logical NOT on all given filters combined by AND."""
81+
NOT: [LinkSubscriptionWhereInput!]
82+
83+
"""
84+
The subscription event gets dispatched when it's listed in mutation_in
85+
"""
86+
mutation_in: [MutationType!]
87+
88+
"""
89+
The subscription event gets only dispatched when one of the updated fields names is included in this list
90+
"""
91+
updatedFields_contains: String
92+
93+
"""
94+
The subscription event gets only dispatched when all of the field names included in this list have been updated
95+
"""
96+
updatedFields_contains_every: [String!]
97+
98+
"""
99+
The subscription event gets only dispatched when some of the field names included in this list have been updated
100+
"""
101+
updatedFields_contains_some: [String!]
102+
node: LinkWhereInput
103+
}
104+
105+
input LinkUpdateInput {
106+
description: String
107+
url: String
108+
}
109+
110+
input LinkWhereInput {
111+
"""Logical AND on all given filters."""
112+
AND: [LinkWhereInput!]
113+
114+
"""Logical OR on all given filters."""
115+
OR: [LinkWhereInput!]
116+
117+
"""Logical NOT on all given filters combined by AND."""
118+
NOT: [LinkWhereInput!]
119+
id: ID
120+
121+
"""All values that are not equal to given value."""
122+
id_not: ID
123+
124+
"""All values that are contained in given list."""
125+
id_in: [ID!]
126+
127+
"""All values that are not contained in given list."""
128+
id_not_in: [ID!]
129+
130+
"""All values less than the given value."""
131+
id_lt: ID
132+
133+
"""All values less than or equal the given value."""
134+
id_lte: ID
135+
136+
"""All values greater than the given value."""
137+
id_gt: ID
138+
139+
"""All values greater than or equal the given value."""
140+
id_gte: ID
141+
142+
"""All values containing the given string."""
143+
id_contains: ID
144+
145+
"""All values not containing the given string."""
146+
id_not_contains: ID
147+
148+
"""All values starting with the given string."""
149+
id_starts_with: ID
150+
151+
"""All values not starting with the given string."""
152+
id_not_starts_with: ID
153+
154+
"""All values ending with the given string."""
155+
id_ends_with: ID
156+
157+
"""All values not ending with the given string."""
158+
id_not_ends_with: ID
159+
createdAt: DateTime
160+
161+
"""All values that are not equal to given value."""
162+
createdAt_not: DateTime
163+
164+
"""All values that are contained in given list."""
165+
createdAt_in: [DateTime!]
166+
167+
"""All values that are not contained in given list."""
168+
createdAt_not_in: [DateTime!]
169+
170+
"""All values less than the given value."""
171+
createdAt_lt: DateTime
172+
173+
"""All values less than or equal the given value."""
174+
createdAt_lte: DateTime
175+
176+
"""All values greater than the given value."""
177+
createdAt_gt: DateTime
178+
179+
"""All values greater than or equal the given value."""
180+
createdAt_gte: DateTime
181+
description: String
182+
183+
"""All values that are not equal to given value."""
184+
description_not: String
185+
186+
"""All values that are contained in given list."""
187+
description_in: [String!]
188+
189+
"""All values that are not contained in given list."""
190+
description_not_in: [String!]
191+
192+
"""All values less than the given value."""
193+
description_lt: String
194+
195+
"""All values less than or equal the given value."""
196+
description_lte: String
197+
198+
"""All values greater than the given value."""
199+
description_gt: String
200+
201+
"""All values greater than or equal the given value."""
202+
description_gte: String
203+
204+
"""All values containing the given string."""
205+
description_contains: String
206+
207+
"""All values not containing the given string."""
208+
description_not_contains: String
209+
210+
"""All values starting with the given string."""
211+
description_starts_with: String
212+
213+
"""All values not starting with the given string."""
214+
description_not_starts_with: String
215+
216+
"""All values ending with the given string."""
217+
description_ends_with: String
218+
219+
"""All values not ending with the given string."""
220+
description_not_ends_with: String
221+
url: String
222+
223+
"""All values that are not equal to given value."""
224+
url_not: String
225+
226+
"""All values that are contained in given list."""
227+
url_in: [String!]
228+
229+
"""All values that are not contained in given list."""
230+
url_not_in: [String!]
231+
232+
"""All values less than the given value."""
233+
url_lt: String
234+
235+
"""All values less than or equal the given value."""
236+
url_lte: String
237+
238+
"""All values greater than the given value."""
239+
url_gt: String
240+
241+
"""All values greater than or equal the given value."""
242+
url_gte: String
243+
244+
"""All values containing the given string."""
245+
url_contains: String
246+
247+
"""All values not containing the given string."""
248+
url_not_contains: String
249+
250+
"""All values starting with the given string."""
251+
url_starts_with: String
252+
253+
"""All values not starting with the given string."""
254+
url_not_starts_with: String
255+
256+
"""All values ending with the given string."""
257+
url_ends_with: String
258+
259+
"""All values not ending with the given string."""
260+
url_not_ends_with: String
261+
}
262+
263+
input LinkWhereUniqueInput {
264+
id: ID
265+
}
266+
267+
"""
268+
The `Long` scalar type represents non-fractional signed whole numeric values.
269+
Long can represent values between -(2^63) and 2^63 - 1.
270+
"""
271+
scalar Long
272+
273+
type Mutation {
274+
createLink(data: LinkCreateInput!): Link!
275+
updateLink(data: LinkUpdateInput!, where: LinkWhereUniqueInput!): Link
276+
deleteLink(where: LinkWhereUniqueInput!): Link
277+
upsertLink(where: LinkWhereUniqueInput!, create: LinkCreateInput!, update: LinkUpdateInput!): Link!
278+
updateManyLinks(data: LinkUpdateInput!, where: LinkWhereInput): BatchPayload!
279+
deleteManyLinks(where: LinkWhereInput): BatchPayload!
280+
}
281+
282+
enum MutationType {
283+
CREATED
284+
UPDATED
285+
DELETED
286+
}
287+
288+
"""An object with an ID"""
289+
interface Node {
290+
"""The id of the object."""
291+
id: ID!
292+
}
293+
294+
"""Information about pagination in a connection."""
295+
type PageInfo {
296+
"""When paginating forwards, are there more items?"""
297+
hasNextPage: Boolean!
298+
299+
"""When paginating backwards, are there more items?"""
300+
hasPreviousPage: Boolean!
301+
302+
"""When paginating backwards, the cursor to continue."""
303+
startCursor: String
304+
305+
"""When paginating forwards, the cursor to continue."""
306+
endCursor: String
307+
}
308+
309+
type Query {
310+
links(where: LinkWhereInput, orderBy: LinkOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Link]!
311+
link(where: LinkWhereUniqueInput!): Link
312+
linksConnection(where: LinkWhereInput, orderBy: LinkOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): LinkConnection!
313+
314+
"""Fetches an object given its ID"""
315+
node(
316+
"""The ID of an object"""
317+
id: ID!
318+
): Node
319+
}
320+
321+
type Subscription {
322+
link(where: LinkSubscriptionWhereInput): LinkSubscriptionPayload
323+
}

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const server = new GraphQLServer({
4141
context: req => ({
4242
...req,
4343
db: new Prisma({
44-
typeDefs: './database/datamodel.graphql',
44+
typeDefs: 'src/generated/prisma.graphql',
4545
endpoint: 'http://localhost:4466',
4646
secret: 'hoge',
4747
debug: true,

0 commit comments

Comments
 (0)