Skip to content

Commit e15ba65

Browse files
Raise limit for tokens sets when syncing to TS provider (#3247)
1 parent 7a10541 commit e15ba65

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

.changeset/heavy-sheep-float.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tokens-studio/figma-plugin": patch
3+
---
4+
5+
Raise limit for token sets to 100 when syncing with Tokens Studio provider

packages/tokens-studio-for-figma/src/storage/TokensStudioTokenStorage.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ async function getProjectData(id: string, orgId: string, client: any): Promise<P
6262
}
6363

6464
const tokenSets = data.data.project.branch.tokenSets.data as TokensSet[];
65+
const { totalPages } = data.data.project.branch.tokenSets;
66+
67+
// TODO: This is a temporary solution until we implement pagination
68+
if (totalPages > 1) {
69+
notifyToUI('We are currently supporting up to 100 sets, if you encounter this issue and need even more sets please reach out to us on slack or featurebase.', { error: true });
70+
}
6571

6672
const returnData = tokenSets.reduce(
6773
(acc, tokenSet) => {

packages/tokens-studio-for-figma/src/storage/tokensStudio/graphql/getProjectDataQuery.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const GET_PROJECT_DATA_QUERY = gql`
44
query Branch($projectId: String!, $organization: String!, $name: String) {
55
project(id: $projectId, organization: $organization) {
66
branch(name: $name) {
7-
tokenSets {
7+
tokenSets(limit: 100) {
88
data {
99
name
1010
orderIndex
@@ -17,6 +17,7 @@ export const GET_PROJECT_DATA_QUERY = gql`
1717
value
1818
}
1919
}
20+
totalPages
2021
}
2122
themeGroups {
2223
data {

0 commit comments

Comments
 (0)