Environment Variables
Grafbase supports the use of environment variables inside of the file schema.graphql
.
Inside of your local grafbase
folder you can create the file .env
that contains the key/value pairs that match those used inside of your schema.
Here we can have a schema with the OIDC issuer URL set as an environment variable:
schema
@auth(
providers: [{ type: oidc, issuer: "{{ env.ISSUER_URL }}" }]
rules: [{ allow: private }]
) {
query: Query
}
In production these will read from your Grafbase project settings, but locally you'll want to set these to read from your local grafbase/.env
file:
ISSUER_URL=https://...
Learn more about environment variables.