Skip to content

Commit c7a15db

Browse files
committed
iterate
1 parent 70ae273 commit c7a15db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1388
-2834
lines changed

TODO.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
- Handle errors properly, with toasts. There are many console.error('Failed to delete comment:', error) in the codebase.
44
- Keep showing the loading state until subscriptions are all set up.
5-
- When voting, the local cache needs to be updated.
5+
- Setting speaker when editing statement doesn't work.
6+
- Speaker focus
7+
- BackgroundNotifier
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ export const UPDATE_STATEMENT_MUTATION = gql`
175175
time
176176
text
177177
isDraft
178+
speaker {
179+
id
180+
}
178181
video {
179182
id
180183
}
@@ -275,3 +278,123 @@ export const CREATE_SPEAKER_MUTATION = gql`
275278
}
276279
}
277280
`
281+
282+
export const REMOVE_SPEAKER_FROM_VIDEO_MUTATION = gql`
283+
mutation RemoveSpeakerFromVideo($videoId: ID!, $speakerId: ID!) {
284+
removeSpeakerFromVideo(videoId: $videoId, speakerId: $speakerId) {
285+
id
286+
}
287+
}
288+
`
289+
290+
export const UPDATE_SPEAKER_MUTATION = gql`
291+
mutation UpdateSpeaker($id: ID!, $fullName: String, $title: String, $wikidataItemId: String) {
292+
updateSpeaker(id: $id, fullName: $fullName, title: $title, wikidataItemId: $wikidataItemId) {
293+
id
294+
fullName
295+
title
296+
wikidataItemId
297+
picture
298+
slug
299+
}
300+
}
301+
`
302+
303+
export const RESTORE_STATEMENT_MUTATION = gql`
304+
mutation RestoreStatement($id: ID!) {
305+
restoreStatement(id: $id) {
306+
id
307+
text
308+
time
309+
isDraft
310+
speaker {
311+
id
312+
fullName
313+
picture
314+
}
315+
video {
316+
id
317+
}
318+
}
319+
}
320+
`
321+
322+
export const RESTORE_SPEAKER_MUTATION = gql`
323+
mutation RestoreSpeaker($speakerId: ID!, $videoId: ID!) {
324+
restoreSpeaker(speakerId: $speakerId, videoId: $videoId) {
325+
id
326+
fullName
327+
slug
328+
picture
329+
}
330+
}
331+
`
332+
333+
export const SPEAKER_QUERY = gql`
334+
query Speaker($id: ID, $slug: String) {
335+
speaker(id: $id, slug: $slug) {
336+
id
337+
slug
338+
fullName
339+
title
340+
wikidataItemId
341+
picture
342+
videos {
343+
id
344+
hashId
345+
title
346+
thumbnail
347+
insertedAt
348+
isPartner
349+
}
350+
}
351+
}
352+
`
353+
354+
export const VIDEO_HISTORY_ACTIONS_QUERY = gql`
355+
query VideoHistoryActions($videoId: ID!) {
356+
videoHistoryActions(videoId: $videoId) {
357+
id
358+
type
359+
entity
360+
changes
361+
time
362+
user {
363+
id
364+
username
365+
name
366+
pictureUrl
367+
miniPictureUrl
368+
}
369+
speakerId
370+
statementId
371+
commentId
372+
videoId
373+
videoHashId
374+
}
375+
}
376+
`
377+
378+
export const VIDEO_HISTORY_ACTION_ADDED_SUBSCRIPTION = gql`
379+
subscription VideoHistoryActionAdded($videoId: ID!) {
380+
videoHistoryActionAdded(videoId: $videoId) {
381+
id
382+
type
383+
entity
384+
changes
385+
time
386+
user {
387+
id
388+
username
389+
name
390+
pictureUrl
391+
miniPictureUrl
392+
}
393+
speakerId
394+
statementId
395+
commentId
396+
videoId
397+
videoHashId
398+
}
399+
}
400+
`

0 commit comments

Comments
 (0)