Skip to content

Commit 8d050d3

Browse files
committed
fix: align to schema
1 parent 91f911a commit 8d050d3

File tree

2 files changed

+117
-59
lines changed

2 files changed

+117
-59
lines changed

schema.graphql

Lines changed: 116 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ enum Action {
2727
CREATE_TOPIC
2828
CREATE_USE_CASE_VERSION
2929
CREATE_WORKSPACE
30+
CREATE_WORKSPACE_VERSION
3031
DELETE_BLOG_ARTICLE
3132
DELETE_COMMENT
3233
DELETE_COMPETITION
@@ -45,6 +46,7 @@ enum Action {
4546
DELETE_TOPIC
4647
DELETE_USER
4748
DELETE_WORKSPACE
49+
DELETE_WORKSPACE_VERSION
4850
FETCH_WEBSITE_METADATA
4951
JOIN_COMPETITION
5052
JOIN_EVENT
@@ -84,6 +86,7 @@ enum Action {
8486
READ_USER_NOTIFICATIONS
8587
READ_USER_PERMISSIONS
8688
READ_WORKSPACE
89+
READ_WORKSPACE_VERSION
8790
REEVALUATE_COMPETITION
8891
REMOVE_COMPETITION_JURY
8992
REMOVE_COMPETITION_MEMBER
@@ -161,6 +164,7 @@ enum ActivityKind {
161164
ALL
162165
COMPETITION
163166
DATASET
167+
WORKSPACE
164168
}
165169

166170
enum ActivityVisibility {
@@ -392,6 +396,22 @@ enum Badge {
392396
Hack The Horizon – Participation Badge
393397
"""
394398
HTH_PARTICIPATION
399+
"""
400+
Q-volution Hackathon 2026 -- Energy Grid Optiminization
401+
"""
402+
QVOLUTION_26_ENERGY
403+
"""
404+
Q-volution Hackathon 2026 -- Solving Linear Differential Equations
405+
"""
406+
QVOLUTION_26_LINEAR_DIFF
407+
"""
408+
Q-volution Hackathon 2026 -- Quantum for Good
409+
"""
410+
QVOLUTION_26_QUANTUM_FOR_GOOD
411+
"""
412+
Q-volution Hackathon 2026 -- Option Pricing in Finance
413+
"""
414+
QVOLUTION_26_FINANCE
395415
UNKNOWN
396416
}
397417

@@ -410,14 +430,14 @@ type BlogArticle implements Node {
410430
seoDescription: String
411431
imageAlt: String
412432
id: ID!
433+
viewerCan(action: Action!, asEntity: UsernameOrID): Boolean!
413434
image: Url
414435
authors(after: String, before: String, first: Int, last: Int): BlogArticleAuthorConnection!
415436
topic: Topic!
416437
title: String!
417438
slugLower: String!
418439
content: String
419440
createdAt: DateTime!
420-
viewerCan(action: Action!, asEntity: UsernameOrID): Boolean!
421441
}
422442

423443
type BlogArticleAuthorConnection {
@@ -483,6 +503,7 @@ type Comment implements Votable & Node {
483503
createdAt: DateTime!
484504
edited: Boolean!
485505
id: ID!
506+
viewerCan(action: Action!, asEntity: UsernameOrID): Boolean!
486507
content: String!
487508
author: User!
488509
topic: Topic!
@@ -492,7 +513,6 @@ type Comment implements Votable & Node {
492513
voterCount: Int!
493514
voters(after: String, before: String, first: Int, last: Int): VotersConnection!
494515
children(after: String, before: String, first: Int, last: Int, order: VotableOrder): CommentConnection!
495-
viewerCan(action: Action!, asEntity: UsernameOrID): Boolean!
496516
}
497517

498518
type CommentConnection {
@@ -525,7 +545,7 @@ type CommentEdge {
525545
cursor: String!
526546
}
527547

528-
type Competition implements ForumOwner & Subscribable & Node {
548+
type Competition implements ForumOwner & Subscribable & Node & Taggable {
529549
slug: String!
530550
title: String!
531551
shortDescription: String!
@@ -557,7 +577,7 @@ type Competition implements ForumOwner & Subscribable & Node {
557577
timeline: Timeline
558578
membership(entity: UsernameOrID): CompetitionMembership
559579
members(after: String, before: String, first: Int, last: Int, search: String): CompetitionMembershipConnection!
560-
tags(after: String, before: String, first: Int, last: Int): CompetitionTagConnection!
580+
tags(after: String, before: String, first: Int, last: Int): TaggableConnection!
561581
entitySubscription(entity: UsernameOrID): SubjectSubscription
562582
jury(after: String, before: String, first: Int, last: Int): CompetitionJuryConnection!
563583
datasets(after: String, before: String, first: Int, last: Int): CompetitionDatasetConnection!
@@ -842,21 +862,6 @@ type CompetitionSubscription implements SubjectSubscription & Node {
842862
subject: Subscribable!
843863
}
844864

845-
type CompetitionTagConnection {
846-
"""
847-
Information to aid in pagination.
848-
"""
849-
pageInfo: PageInfo!
850-
"""
851-
A list of edges.
852-
"""
853-
edges: [TagEdge!]!
854-
"""
855-
A list of nodes.
856-
"""
857-
nodes: [Tag!]!
858-
}
859-
860865
type CompetitionTeamRequest implements Node {
861866
skills: String!
862867
needs: String!
@@ -1067,8 +1072,12 @@ input CreateTopicInput {
10671072
input CreateWorkspaceInput {
10681073
fromWorkspaceId: UUID
10691074
name: String!
1070-
slug: String!
10711075
private: Boolean!
1076+
shortDescription: String
1077+
}
1078+
1079+
input CreateWorkspaceVersionInput {
1080+
version: Semver!
10721081
}
10731082

10741083
type DOI {
@@ -1077,7 +1086,7 @@ type DOI {
10771086
url: Url!
10781087
}
10791088

1080-
type Dataset implements Votable & ForumOwner & Node {
1089+
type Dataset implements Votable & ForumOwner & Node & Taggable {
10811090
localSlug: String!
10821091
name: String!
10831092
private: Boolean!
@@ -1096,7 +1105,7 @@ type Dataset implements Votable & ForumOwner & Node {
10961105
version(major: Int!, minor: Int!, patch: Int!): DatasetVersion
10971106
versions(after: String, before: String, first: Int, last: Int, filters: DatasetVersionQueryFilters): DatasetVersionConnection!
10981107
competitions(after: String, before: String, first: Int, last: Int, search: String): DatasetCompetitionConnection!
1099-
tags(after: String, before: String, first: Int, last: Int): DatasetTagConnection!
1108+
tags(after: String, before: String, first: Int, last: Int): TaggableConnection!
11001109
voted: EntityVote
11011110
voterCount: Int!
11021111
voters(after: String, before: String, first: Int, last: Int): VotersConnection!
@@ -1230,36 +1239,6 @@ type DatasetSize {
12301239
high: Int!
12311240
}
12321241

1233-
type DatasetTagConnection {
1234-
"""
1235-
Information to aid in pagination.
1236-
"""
1237-
pageInfo: PageInfo!
1238-
"""
1239-
A list of edges.
1240-
"""
1241-
edges: [DatasetTagConnectionEdge!]!
1242-
"""
1243-
A list of nodes.
1244-
"""
1245-
nodes: [Tag!]!
1246-
totalCount: Int!
1247-
}
1248-
1249-
"""
1250-
An edge in a connection.
1251-
"""
1252-
type DatasetTagConnectionEdge {
1253-
"""
1254-
The item at the end of the edge
1255-
"""
1256-
node: Tag!
1257-
"""
1258-
A cursor for use in pagination
1259-
"""
1260-
cursor: String!
1261-
}
1262-
12631242
type DatasetVersion implements Node {
12641243
version: Semver!
12651244
license: String
@@ -1920,10 +1899,10 @@ type Forum implements ForumOwner & Subscribable & Node {
19201899
orderingPriority: Int!
19211900
createdAt: DateTime!
19221901
id: ID!
1902+
viewerCan(action: Action!, asEntity: UsernameOrID): Boolean!
19231903
description: String
19241904
owner: ForumOwner!
19251905
forum: Forum!
1926-
viewerCan(action: Action!, asEntity: UsernameOrID): Boolean!
19271906
icon: Url
19281907
topics(after: String, before: String, first: Int, last: Int, order: VotableOrder): TopicConnection!
19291908
entitySubscription(entity: UsernameOrID): SubjectSubscription
@@ -1972,6 +1951,7 @@ enum ForumOwnerKind {
19721951
COMPETITION
19731952
EVENT
19741953
DATASET
1954+
WORKSPACE
19751955
}
19761956

19771957
type ForumSubscription implements SubjectSubscription & Node {
@@ -2188,9 +2168,12 @@ type Mutation {
21882168
the last part was uploaded.
21892169
"""
21902170
completeDatasetVersionFile(datasetVersionFileId: ID!, eTags: [String!]!): DatasetVersionFile!
2171+
deleteWorkspaceRunners(workspaceId: ID!): ID!
21912172
createWorkspace(input: CreateWorkspaceInput!, asEntity: UsernameOrID): Workspace!
21922173
updateWorkspace(id: ID!, input: UpdateWorkspaceInput!): Workspace!
21932174
deleteWorkspace(id: ID!): ID!
2175+
createWorkspaceVersion(id: ID!, input: CreateWorkspaceVersionInput!): WorkspaceVersion!
2176+
deleteWorkspaceVersion(id: ID!): ID!
21942177
}
21952178

21962179
"""
@@ -2917,6 +2900,27 @@ input TagQueryFilters {
29172900
activityKind: ActivityKind = null
29182901
}
29192902

2903+
interface Taggable {
2904+
id: ID!
2905+
tags(before: String, after: String, first: Int, last: Int): TaggableConnection!
2906+
}
2907+
2908+
type TaggableConnection {
2909+
"""
2910+
Information to aid in pagination.
2911+
"""
2912+
pageInfo: PageInfo!
2913+
"""
2914+
A list of edges.
2915+
"""
2916+
edges: [TagEdge!]!
2917+
"""
2918+
A list of nodes.
2919+
"""
2920+
nodes: [Tag!]!
2921+
totalCount: Int!
2922+
}
2923+
29202924
scalar TimeZone
29212925

29222926
type Timeline {
@@ -2975,8 +2979,8 @@ type Topic implements Votable & Subscribable & Node {
29752979
votes: Int!
29762980
createdAt: DateTime!
29772981
id: ID!
2978-
description: String
29792982
viewerCan(action: Action!, asEntity: UsernameOrID): Boolean!
2983+
description: String
29802984
author: Entity!
29812985
forum: Forum!
29822986
commentCount: Int!
@@ -3253,8 +3257,10 @@ input UpdateUserInput {
32533257

32543258
input UpdateWorkspaceInput {
32553259
name: String
3256-
slug: String
32573260
private: Boolean
3261+
tags: [String!]
3262+
shortDescription: String
3263+
license: String
32583264
}
32593265

32603266
scalar Upload
@@ -3431,24 +3437,33 @@ type WebsiteMetadata {
34313437
description: String
34323438
}
34333439

3434-
type Workspace implements Votable & Node {
3440+
type Workspace implements Votable & ForumOwner & Node & Taggable {
34353441
storage: String
34363442
name: String
3437-
slug: String
3443+
localSlug: String
34383444
createdAt: DateTime!
34393445
votes: Int!
34403446
private: Boolean!
3447+
shortDescription: String
3448+
license: String
34413449
id: ID!
34423450
viewerCan(action: Action!, asEntity: UsernameOrID): Boolean!
34433451
owner: Entity!
34443452
datasetVersion: DatasetVersion
34453453
editor: WorkspaceRunner
34463454
viewer: WorkspaceRunner
34473455
runners(first: Int, after: String): WorkspaceRunnerConnection!
3456+
forum: Forum!
3457+
forumOwnerKind: ForumOwnerKind!
3458+
slug: String!
34483459
voted: EntityVote
34493460
voterCount: Int!
34503461
voters(after: String, before: String, first: Int, last: Int): VotersConnection!
3451-
entries: [WorkspaceEntry!]!
3462+
tags(after: String, before: String, first: Int, last: Int): TaggableConnection!
3463+
entries: [WorkspaceEntry!]
3464+
versions(after: String, before: String, first: Int, last: Int): WorkspaceVersionConnection!
3465+
version(version: Semver!): WorkspaceVersion
3466+
latestVersion: WorkspaceVersion
34523467
}
34533468

34543469
type WorkspaceConnection {
@@ -3469,6 +3484,7 @@ type WorkspaceConnection {
34693484

34703485
input WorkspaceConnectionFilters {
34713486
search: String
3487+
tags: [String!]
34723488
order: WorkspaceConnectionOrder! = CREATED_AT
34733489
}
34743490

@@ -3550,7 +3566,8 @@ type WorkspaceRunnerEdge {
35503566
}
35513567

35523568
type WorkspaceRunnerStatus {
3553-
ready: Boolean!
3569+
podReady: Boolean!
3570+
runner: WorkspaceRunner!
35543571
}
35553572

35563573
type WorkspaceSymlink implements WorkspaceEntry {
@@ -3566,6 +3583,46 @@ type WorkspaceUnknownEntry implements WorkspaceEntry {
35663583
modified: DateTime
35673584
}
35683585

3586+
type WorkspaceVersion implements Node {
3587+
version: Semver!
3588+
latest: Boolean!
3589+
createdAt: DateTime!
3590+
id: ID!
3591+
viewerCan(action: Action!, asEntity: UsernameOrID): Boolean!
3592+
workspace: Workspace!
3593+
entity: Entity!
3594+
viewer: WorkspaceRunner
3595+
}
3596+
3597+
type WorkspaceVersionConnection {
3598+
"""
3599+
Information to aid in pagination.
3600+
"""
3601+
pageInfo: PageInfo!
3602+
"""
3603+
A list of edges.
3604+
"""
3605+
edges: [WorkspaceVersionEdge!]!
3606+
"""
3607+
A list of nodes.
3608+
"""
3609+
nodes: [WorkspaceVersion!]!
3610+
}
3611+
3612+
"""
3613+
An edge in a connection.
3614+
"""
3615+
type WorkspaceVersionEdge {
3616+
"""
3617+
The item at the end of the edge
3618+
"""
3619+
node: WorkspaceVersion!
3620+
"""
3621+
A cursor for use in pagination
3622+
"""
3623+
cursor: String!
3624+
}
3625+
35693626
"""
35703627
Marks an element of a GraphQL schema as no longer supported.
35713628
"""

src/workspace.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub async fn download_workspace_notebook(
3434

3535
let download_url = workspace
3636
.entries
37+
.unwrap_or_default()
3738
.into_iter()
3839
.find_map(|entry| match entry {
3940
get_workspace_notebook_download_url::GetWorkspaceNotebookDownloadUrlWorkspaceBySlugEntries::WorkspaceFile(

0 commit comments

Comments
 (0)