Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clever-mangos-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@team-plain/typescript-sdk': minor
---

Add support for changing thread priority. Expose ThreadStatus and other useful enums and types
21 changes: 21 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,27 @@ export class PlainClient {
});
}

/**
* WARNING: This is experimental and subject to change at any time without
* a major version bump.
*/
async changeThreadPriority(input: VariablesOf<typeof CreateThreadDocument>['input']): SDKResult<{
thread: ThreadPartsFragment;
}> {
const res = await request(this.#ctx, {
query: CreateThreadDocument,
variables: {
input,
},
});

return unwrapData(res, (q) => {
return {
thread: nonNullable(q.createThread.thread),
};
});
}

/**
* WARNING: This is experimental and subject to change at any time without
* a major version bump.
Expand Down
10 changes: 10 additions & 0 deletions src/graphql/mutations/changeThreadPriority.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
mutation changeThreadPriority($input: ChangeThreadPriorityInput!) {
changeThreadPriority(input: $input) {
thread {
...ThreadParts
}
error {
...MutationErrorParts
}
}
}
Loading