-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.graphql
More file actions
114 lines (86 loc) · 2.58 KB
/
schema.graphql
File metadata and controls
114 lines (86 loc) · 2.58 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
"""Directs the executor to return values as a Streaming response."""
directive @live on QUERY
"""Indicates that an input object is a oneOf input object"""
directive @oneOf on INPUT_OBJECT
"""
A date-time string at UTC, such as 2007-12-03T10:15:30Z, is compliant with the date-time format outlined in section 5.6 of the RFC 3339
profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.
This scalar is a description of an exact instant on the timeline such as the instant that a user account was created.
# Input Coercion
When expected as an input type, only RFC 3339 compliant date-time strings are accepted. All other input values raise a query error indicating an incorrect type.
# Result Coercion
Where an RFC 3339 compliant date-time string has a time-zone other than UTC, it is shifted to UTC.
For example, the date-time string 2016-01-01T14:10:20+01:00 is shifted to 2016-01-01T13:10:20Z.
"""
scalar DateTime
type Message {
author: String!
"""when the model was created"""
createdAt: DateTime!
"""Unique identifier"""
id: ID!
message: String!
"""when the model was updated"""
updatedAt: DateTime!
}
input MessageByInput {
id: ID
}
type MessageConnection {
edges: [MessageEdge]
"""Information to aid in pagination"""
pageInfo: PageInfo!
}
"""Input to create a Message"""
input MessageCreateInput {
author: String!
message: String!
}
type MessageCreatePayload {
message: Message
}
type MessageDeletePayload {
deletedId: ID!
}
type MessageEdge {
cursor: String!
node: Message!
}
input MessageOrderByInput {
createdAt: OrderByDirection
}
"""Input to update a Message"""
input MessageUpdateInput {
author: String
message: String
}
type MessageUpdatePayload {
message: Message
}
type Mutation {
"""Create a Message"""
messageCreate(input: MessageCreateInput!): MessageCreatePayload
"""Delete a Message by ID or unique field"""
messageDelete(by: MessageByInput!): MessageDeletePayload
"""Update a Message"""
messageUpdate(by: MessageByInput!, input: MessageUpdateInput!): MessageUpdatePayload
}
enum OrderByDirection {
ASC
DESC
}
type PageInfo {
endCursor: String
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
}
type Query {
"""Query a single Message by an ID or a unique field"""
message(
"""The field and value by which to query the Message"""
by: MessageByInput!
): Message
"""Paginated query to fetch the whole list of `Message`."""
messageCollection(after: String, before: String, first: Int, last: Int, orderBy: MessageOrderByInput): MessageConnection
}