Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit 6afc8b2

Browse files
authored
fix: add console warning when creating score using generationId (#76)
1 parent 0b84cf5 commit 6afc8b2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/api.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,6 +1368,11 @@ export class API {
13681368
* @returns A promise that resolves to an array of `Score` instances populated with the created scores' data.
13691369
*/
13701370
async createScores(scores: Score[]): Promise<Score[]> {
1371+
if (scores.some((score) => score.generationId)) {
1372+
console.warn(
1373+
'generationId is deprecated and will be removed in a future version, please use stepId instead'
1374+
);
1375+
}
13711376
const query = createScoresQueryBuilder(scores);
13721377
const variables = variablesBuilder(scores);
13731378

@@ -1426,7 +1431,11 @@ export class API {
14261431
}
14271432
}
14281433
`;
1429-
1434+
if (variables.generationId) {
1435+
console.warn(
1436+
'generationId is deprecated and will be removed in a future version, please use stepId instead'
1437+
);
1438+
}
14301439
const result = await this.makeGqlCall(query, variables);
14311440
return new Score(result.data.createScore);
14321441
}

0 commit comments

Comments
 (0)