Skip to content

Commit e13f893

Browse files
better deriving (codesandbox#3844)
* better deriving * fix skeleton * remove user check, not needed anymore
1 parent 043ce98 commit e13f893

File tree

7 files changed

+233
-351
lines changed

7 files changed

+233
-351
lines changed

packages/app/src/app/graphql/schema.graphql

Lines changed: 69 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# source: https://codesandbox.stream/api/graphql
2-
# timestamp: Wed Apr 08 2020 10:19:39 GMT+0200 (Central European Summer Time)
1+
# source: https://codesandbox.io/api/graphql
2+
# timestamp: Wed Apr 08 2020 13:07:11 GMT+0200 (Central European Summer Time)
33

44
schema {
55
query: RootQuery
@@ -21,9 +21,7 @@ type Bookmarked {
2121
isBookmarked: Boolean
2222
}
2323

24-
"""
25-
A team or the current user
26-
"""
24+
"""A team or the current user"""
2725
union BookmarkEntity = Team | User
2826

2927
input CodeReference {
@@ -40,9 +38,7 @@ type CodeReferenceMetadata {
4038
path: String!
4139
}
4240

43-
"""
44-
A collaborator on a sandbox
45-
"""
41+
"""A collaborator on a sandbox"""
4642
type Collaborator {
4743
authorization: Authorization!
4844
id: ID!
@@ -118,9 +114,7 @@ type Git {
118114
username: String
119115
}
120116

121-
"""
122-
An invitation to a sandbox
123-
"""
117+
"""An invitation to a sandbox"""
124118
type Invitation {
125119
authorization: Authorization!
126120
email: String
@@ -155,179 +149,96 @@ type Reference {
155149
type: String!
156150
}
157151

158-
"""
159-
The metadata of a reference
160-
"""
152+
"""The metadata of a reference"""
161153
union ReferenceMetadata = CodeReferenceMetadata
162154

163155
type RootMutation {
164-
"""
165-
Unbookmark a template
166-
"""
167-
unbookmarkTemplate(teamId: ID, templateId: ID!): Template
156+
"""Reject an invitation to a team"""
157+
rejectTeamInvitation(teamId: ID!): String
168158

169-
"""
170-
bookmark a template
171-
"""
172-
bookmarkTemplate(teamId: ID, templateId: ID!): Template
159+
"""Rename a collection and all subfolders"""
160+
renameCollection(newPath: String!, newTeamId: ID, path: String!, teamId: ID): [Collection!]!
173161

174-
"""
175-
Create a collection
176-
"""
177-
createCollection(path: String!, teamId: ID): Collection!
162+
"""Revoke an invitation to a team"""
163+
revokeTeamInvitation(teamId: ID!, userId: ID!): Team
164+
revokeSandboxInvitation(invitationId: ID!, sandboxId: ID!): Invitation!
165+
updateComment(commentId: ID!, content: String, sandboxId: ID!): Comment!
166+
changeSandboxInvitationAuthorization(authorization: Authorization!, invitationId: ID!, sandboxId: ID!): Invitation!
178167

179-
"""
180-
Rename a collection and all subfolders
181-
"""
182-
renameCollection(
183-
newPath: String!
184-
newTeamId: ID
185-
path: String!
186-
teamId: ID
187-
): [Collection!]!
188-
189-
"""
190-
Add a collaborator
191-
"""
192-
addCollaborator(
193-
authorization: Authorization!
194-
sandboxId: ID!
195-
username: String!
196-
): Collaborator!
197-
198-
"""
199-
Delete a collection and all subfolders
200-
"""
168+
"""Delete a collection and all subfolders"""
201169
deleteCollection(path: String!, teamId: ID): [Collection!]!
170+
redeemSandboxInvitation(invitationToken: String!, sandboxId: ID!): Invitation!
202171

203-
"""
204-
Accept an invitation to a team
205-
"""
172+
"""Unbookmark a template"""
173+
unbookmarkTemplate(teamId: ID, templateId: ID!): Template
174+
175+
"""Set the description of the team"""
176+
setTeamDescription(description: String!, teamId: ID!): Team
177+
createSandboxInvitation(authorization: Authorization!, email: String!, sandboxId: ID!): Invitation!
178+
179+
"""Accept an invitation to a team"""
206180
acceptTeamInvitation(teamId: ID!): Team
207-
permanentlyDeleteSandboxes(sandboxIds: [ID!]!): [Sandbox!]!
208181

209-
"""
210-
Change authorization of a collaborator
211-
"""
212-
changeCollaboratorAuthorization(
213-
authorization: Authorization!
214-
sandboxId: ID!
215-
username: String!
216-
): Collaborator!
217-
revokeSandboxInvitation(invitationId: ID!, sandboxId: ID!): Invitation!
218-
createComment(
219-
codeReference: CodeReference
220-
content: String!
221-
id: ID
222-
parentCommentId: ID
223-
sandboxId: ID!
224-
): Comment!
225-
226-
"""
227-
Mark all notifications as read
228-
"""
182+
"""Create a collection"""
183+
createCollection(path: String!, teamId: ID): Collection!
184+
unresolveComment(commentId: ID!, sandboxId: ID!): Comment!
185+
186+
"""Mark all notifications as read"""
229187
markAllNotificationsAsRead: User
230188

231-
"""
232-
Remove someone from a team
233-
"""
234-
removeFromTeam(teamId: ID!, userId: ID!): Team
235-
renameSandbox(id: ID!, title: String!): Sandbox!
189+
"""Delete sandboxes"""
190+
deleteSandboxes(sandboxIds: [ID!]!): [Sandbox!]!
236191

237-
"""
238-
Remove a collaborator
239-
"""
192+
"""Remove a collaborator"""
240193
removeCollaborator(sandboxId: ID!, username: String!): Collaborator!
194+
permanentlyDeleteSandboxes(sandboxIds: [ID!]!): [Sandbox!]!
241195
resolveComment(commentId: ID!, sandboxId: ID!): Comment!
196+
setSandboxesPrivacy(privacy: Int, sandboxIds: [ID!]!): [Sandbox!]!
242197

243-
"""
244-
Convert templates back to sandboxes
245-
"""
246-
unmakeSandboxesTemplates(sandboxIds: [ID!]!): [Template!]!
247-
248-
"""
249-
Revoke an invitation to a team
250-
"""
251-
revokeTeamInvitation(teamId: ID!, userId: ID!): Team
198+
"""Soft delete a comment. Note: all child comments will also be deleted."""
199+
deleteComment(commentId: ID!, sandboxId: ID!): Comment!
252200

253-
"""
254-
Add sandboxes to a collection
255-
"""
256-
addToCollection(
257-
collectionPath: String!
258-
sandboxIds: [ID]!
259-
teamId: ID
260-
): Collection!
261-
262-
"""
263-
Invite someone to a team
264-
"""
201+
"""Invite someone to a team"""
265202
inviteToTeam(teamId: ID!, username: String): Team
203+
renameSandbox(id: ID!, title: String!): Sandbox!
266204

267-
"""
268-
Create a team
269-
"""
270-
createTeam(name: String!): Team
271-
updateComment(commentId: ID!, content: String, sandboxId: ID!): Comment!
205+
"""Leave a team"""
206+
leaveTeam(teamId: ID!): String
272207

273-
"""
274-
Set the description of the team
275-
"""
276-
setTeamDescription(description: String!, teamId: ID!): Team
208+
"""Add a collaborator"""
209+
addCollaborator(authorization: Authorization!, sandboxId: ID!, username: String!): Collaborator!
277210

278-
"""
279-
Make templates from sandboxes
280-
"""
281-
makeSandboxesTemplates(sandboxIds: [ID!]!): [Template!]!
282-
unresolveComment(commentId: ID!, sandboxId: ID!): Comment!
211+
"""Add sandboxes to a collection"""
212+
addToCollection(collectionPath: String!, sandboxIds: [ID]!, teamId: ID): Collection!
283213

284-
"""
285-
Clear notification unread count
286-
"""
214+
"""Clear notification unread count"""
287215
clearNotificationCount: User
288216

289-
"""
290-
Soft delete a comment. Note: all child comments will also be deleted.
291-
"""
292-
deleteComment(commentId: ID!, sandboxId: ID!): Comment!
217+
"""Make templates from sandboxes"""
218+
makeSandboxesTemplates(sandboxIds: [ID!]!): [Template!]!
293219

294-
"""
295-
Delete sandboxes
296-
"""
297-
deleteSandboxes(sandboxIds: [ID!]!): [Sandbox!]!
220+
"""Change authorization of a collaborator"""
221+
changeCollaboratorAuthorization(authorization: Authorization!, sandboxId: ID!, username: String!): Collaborator!
298222

299-
"""
300-
Reject an invitation to a team
301-
"""
302-
rejectTeamInvitation(teamId: ID!): String
303-
setSandboxesPrivacy(privacy: Int, sandboxIds: [ID!]!): [Sandbox!]!
304-
createSandboxInvitation(
305-
authorization: Authorization!
306-
email: String!
307-
sandboxId: ID!
308-
): Invitation!
309-
310-
"""
311-
Leave a team
312-
"""
313-
leaveTeam(teamId: ID!): String
314-
changeSandboxInvitationAuthorization(
315-
authorization: Authorization!
316-
invitationId: ID!
317-
sandboxId: ID!
318-
): Invitation!
319-
redeemSandboxInvitation(invitationToken: String!, sandboxId: ID!): Invitation!
223+
"""Remove someone from a team"""
224+
removeFromTeam(teamId: ID!, userId: ID!): Team
225+
226+
"""bookmark a template"""
227+
bookmarkTemplate(teamId: ID, templateId: ID!): Template
228+
createComment(codeReference: CodeReference, content: String!, id: ID, parentCommentId: ID, sandboxId: ID!): Comment!
229+
230+
"""Convert templates back to sandboxes"""
231+
unmakeSandboxesTemplates(sandboxIds: [ID!]!): [Template!]!
232+
233+
"""Create a team"""
234+
createTeam(name: String!): Team
320235
}
321236

322237
type RootQuery {
323-
"""
324-
Get current user
325-
"""
238+
"""Get current user"""
326239
me: CurrentUser
327240

328-
"""
329-
Get a sandbox
330-
"""
241+
"""Get a sandbox"""
331242
sandbox(sandboxId: ID!): Sandbox
332243
}
333244

@@ -344,9 +255,7 @@ type RootSubscriptionType {
344255
sandboxChanged(sandboxId: ID!): Sandbox!
345256
}
346257

347-
"""
348-
A Sandbox
349-
"""
258+
"""A Sandbox"""
350259
type Sandbox {
351260
alias: String
352261
author: User
@@ -356,16 +265,12 @@ type Sandbox {
356265
comment(commentId: ID!): Comment
357266
comments: [Comment!]!
358267

359-
"""
360-
If the sandbox is a template this will be set
361-
"""
268+
"""If the sandbox is a template this will be set"""
362269
customTemplate: Template
363270
description: String
364271
forkedTemplate: Template
365272

366-
"""
367-
If the sandbox has a git repo tied to it this will be set
368-
"""
273+
"""If the sandbox has a git repo tied to it this will be set"""
369274
git: Git
370275
id: ID!
371276
insertedAt: String!
@@ -396,9 +301,7 @@ type Team {
396301
users: [User!]!
397302
}
398303

399-
"""
400-
A Template
401-
"""
304+
"""A Template"""
402305
type Template {
403306
bookmarked: [Bookmarked]
404307
color: String
@@ -412,9 +315,7 @@ type Template {
412315
updatedAt: String
413316
}
414317

415-
"""
416-
A CodeSandbox User
417-
"""
318+
"""A CodeSandbox User"""
418319
type User {
419320
avatarUrl: String!
420321
firstName: String

0 commit comments

Comments
 (0)