-
Notifications
You must be signed in to change notification settings - Fork 25
/
demo.graphqls
165 lines (147 loc) · 3.47 KB
/
demo.graphqls
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
schema {
query: Query,
mutation: Mutation
subscription : Subscription
}
type Query {
# Find all persons, optional search by name
persons(filter: InputPerson): [Person!]
# Find a person based by id
person(id: Long!): Person
# Find all talks
talks(filter: InputTalk): [Talk!]
# Find a talk by id
talk(id: Long!): Talk
# Find all conferences
conferences(filter: InputConference): [Conference!]
# Find a conference based on the name
conference(id: Long!): Conference
# Find a comment by id
comment(id: Long!): Comment
# Find comments
comments(page: InputPage): CommentPageableResponse
}
type Mutation {
# Add a new conference
addConference(conference: InputConference!): Conference
# Add a new Person
addPerson(person: InputPerson!): Person
# Add a new Talk
addTalk(talk: InputTalk): Talk
# Add a new comment
addComment(comment: InputComment!): Comment
# Add a talk to a conference
addTalkToConference(conferenceId: Long, talkId: Long): Conference
# Add a speaker to a talk
addSpeakerToTalk(talkId: Long, speakerId: Long): Talk
}
type Subscription {
# Subscribe to all new comments
comments: Comment!
}
# Object to represent a Person
type Person {
# The technical id
id: ID!
# Fullname of the person
name: String!
# URL to the blog
blog: String
# Github account id
githubAccount: String
# Talks given by the person
talks: [Talk!]
}
# Object to represent a talk
type Talk {
# The technical id
id: ID!
# Title of the talk
title: String!
# Short summary of the talk
summary: String
# Speakers of the talk
speakers: [Person!]
# Conferences where the talk is on the agenda
conferences: [Conference!]
}
# Object to represent a conference
type Conference {
# The technical id
id: ID!
# Name of the conference
name: String!
# City where the conference is held
city: String,
# Talks on the conference agenda
talks: [Talk!]
}
# Object to represent a comment
type Comment {
# The technical id
id: ID!
# The comment text
comment: String!
# Creation time of the comment
createdOn : String
# The author of the comment
author: String!
# The talk for which the comment is made
talk: Talk!
}
# Input type for a new Comment
input InputComment {
# The comment text
comment: String!
# The id of the author
author: String!
# The id of the talk
talkId: Long!
}
# Input type for a new Person
input InputPerson {
# Fullname of the person
name: String
# URL to the blog
blog: String
# Github account id
githubAccount: String
}
# Input type for a new Talk
input InputTalk {
# Title of the talk
title: String
# Short summary of the talk
summary: String
}
# Input type for a new Conference
input InputConference {
# Name of the conference
name: String
# City where the conference is held
city: String
}
input InputPage {
# The requested page
page: Long!
# The requested size of the page
size: Long!
}
type PageInfo {
# Total number of elements
totalElements: Long!
# Total number of pages
totalPages: Long!
# Number of elements
numberOfElements: Long!
# Page number
pageNumber: Long!
# Size of the page
pageSize: Long!
}
type CommentPageableResponse {
# Information of the page
pageInfo: PageInfo!
# The comments
content: [Comment]
}