Skip to content

Commit

Permalink
Raise limit for tokens sets when syncing to TS provider (#3247)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebuciuman authored Jan 17, 2025
1 parent 7a10541 commit e15ba65
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/heavy-sheep-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tokens-studio/figma-plugin": patch
---

Raise limit for token sets to 100 when syncing with Tokens Studio provider
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ async function getProjectData(id: string, orgId: string, client: any): Promise<P
}

const tokenSets = data.data.project.branch.tokenSets.data as TokensSet[];
const { totalPages } = data.data.project.branch.tokenSets;

// TODO: This is a temporary solution until we implement pagination
if (totalPages > 1) {
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 });
}

const returnData = tokenSets.reduce(
(acc, tokenSet) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const GET_PROJECT_DATA_QUERY = gql`
query Branch($projectId: String!, $organization: String!, $name: String) {
project(id: $projectId, organization: $organization) {
branch(name: $name) {
tokenSets {
tokenSets(limit: 100) {
data {
name
orderIndex
Expand All @@ -17,6 +17,7 @@ export const GET_PROJECT_DATA_QUERY = gql`
value
}
}
totalPages
}
themeGroups {
data {
Expand Down

0 comments on commit e15ba65

Please sign in to comment.