Skip to content

Commit 18ae5a5

Browse files
authored
Add ability to change thread priority (#65)
1 parent 4dc44c3 commit 18ae5a5

File tree

5 files changed

+51
-0
lines changed

5 files changed

+51
-0
lines changed

.changeset/clever-mangos-reply.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@team-plain/typescript-sdk': minor
3+
---
4+
5+
Add support for changing thread priority. Expose ThreadStatus and other useful enums and types

src/client.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,27 @@ export class PlainClient {
516516
});
517517
}
518518

519+
/**
520+
* WARNING: This is experimental and subject to change at any time without
521+
* a major version bump.
522+
*/
523+
async changeThreadPriority(input: VariablesOf<typeof CreateThreadDocument>['input']): SDKResult<{
524+
thread: ThreadPartsFragment;
525+
}> {
526+
const res = await request(this.#ctx, {
527+
query: CreateThreadDocument,
528+
variables: {
529+
input,
530+
},
531+
});
532+
533+
return unwrapData(res, (q) => {
534+
return {
535+
thread: nonNullable(q.createThread.thread),
536+
};
537+
});
538+
}
539+
519540
/**
520541
* WARNING: This is experimental and subject to change at any time without
521542
* a major version bump.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
mutation changeThreadPriority($input: ChangeThreadPriorityInput!) {
2+
changeThreadPriority(input: $input) {
3+
thread {
4+
...ThreadParts
5+
}
6+
error {
7+
...MutationErrorParts
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)