graphql-hive / graphql-hive/console
Unable to set @graphql-hive/client token in firebase function
- Dominant language
- TypeScript
- Stars
- 483
- Forks
- 145
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 65
Description
For context firebase functions require you to load secrets at runtime but the functions themselves get built so the code is partially executed. So when trying to build this firebase functions project:
```ts
const hiveToken = defineSecret('HIVE_TOKEN');
const graphqlRequestHandler = createYoga({
schema,
graphqlEndpoint: '*',
plugins: [useYogaHive({ enabled: true, token: hiveToken.value(), usage: true })],
});
export const graphql = onRequest({ secrets: [hiveToken] }, graphqlRequestHandler);
```
I get the following error because of the `hiveToken.value()` call during function deployment:
```
Error: Cannot access the value of secret "HIVE_TOKEN" during function deployment. Secret values are only available at runtime.
```
Contributor guide
Assessment
This issue has not been assessed yet.