update sth :)
This commit is contained in:
@@ -204,7 +204,7 @@ export class DocumentSchema extends PothosSchema {
|
||||
},
|
||||
}),
|
||||
|
||||
eventUpdateDocument: t.field({
|
||||
eventDocumentChanged: t.field({
|
||||
type: this.documentDelta(),
|
||||
args: {
|
||||
data: t.arg({
|
||||
@@ -226,6 +226,23 @@ export class DocumentSchema extends PothosSchema {
|
||||
return args.data
|
||||
},
|
||||
}),
|
||||
eventDocumentRequestSync: t.field({
|
||||
type: this.documentDelta(),
|
||||
args: {
|
||||
data: t.arg({
|
||||
type: this.documentDeltaInput(),
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
resolve: async (_, args, ctx: SchemaContext) => {
|
||||
if (ctx.isSubscription) throw new Error('Not allowed')
|
||||
return {
|
||||
...args.data,
|
||||
senderId: ctx.http?.me?.id,
|
||||
eventType: DocumentEvent.REQUEST_SYNC,
|
||||
}
|
||||
},
|
||||
}),
|
||||
|
||||
updateDocument: t.prismaField({
|
||||
type: this.document(),
|
||||
|
||||
Reference in New Issue
Block a user