(privateKey: string)
| 6 | const root = 'https://cdn.builder.io'; |
| 7 | |
| 8 | export const createAdminApiClient = (privateKey: string) => |
| 9 | createClient({ |
| 10 | fetcher: ({ query, variables }, fetch) => |
| 11 | fetch(`${root}/api/v2/admin`, { |
| 12 | method: 'POST', |
| 13 | body: JSON.stringify({ query, variables }), |
| 14 | headers: { |
| 15 | 'Content-Type': 'application/json', |
| 16 | Authorization: `Bearer ${privateKey}`, |
| 17 | }, |
| 18 | }).then(r => r.json()), |
| 19 | }); |
no test coverage detected