( baseUrl: string, userApiKey: string, )
| 111 | } |
| 112 | |
| 113 | export 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 | |
| 137 | export async function getUserMetadataList(baseUrl: string, userApiKey: string) { |
| 138 | const client = getGraphqlClient(baseUrl); |
no test coverage detected