MCPcopy
hub / github.com/IgnisDa/ryot / getFirstExerciseId

Function getFirstExerciseId

tests/src/utils.ts:113–135  ·  view source on GitHub ↗
(
	baseUrl: string,
	userApiKey: string,
)

Source from the content-addressed store, hash-verified

111}
112
113export async function getFirstExerciseId(
114 baseUrl: string,
115 userApiKey: string,
116): Promise<string> {
117 const client = getGraphqlClient(baseUrl);
118 const { userExercisesList } = await client.request(
119 UserExercisesListDocument,
120 {
121 input: {
122 search: { query: "" },
123 },
124 },
125 {
126 Authorization: `Bearer ${userApiKey}`,
127 },
128 );
129
130 if (userExercisesList.response.items.length === 0) {
131 throw new Error("No exercises found in the database");
132 }
133
134 return userExercisesList.response.items[0];
135}
136
137export async function getUserMetadataList(baseUrl: string, userApiKey: string) {
138 const client = getGraphqlClient(baseUrl);

Callers 1

cache.test.tsFile · 0.90

Calls 1

getGraphqlClientFunction · 0.85

Tested by

no test coverage detected