Public Auth rule

Tomas OlveckyTomas OlveckyJamie BartonJamie Barton
Public Auth rule

You can now apply a new public rule to your project's configuration to enable access without an API key or user JWT.

Public access can be enabled globally with { allow: public }:

import { config, graph } from '@grafbase/sdk' const g = graph.Standalone() export default config({ graph: g, auth: { rules: rules => { rules.public() }, }, })

This also means it's easier to connect other APIs using connector to use Grafbase Edge Caching without changing how your client application works.

import { config, connector, graph } from '@grafbase/sdk' const g = graph.Standalone() g.datasource( connector.GraphQL('GitHub', { url: 'https://api.github.com/graphql', }), ) export default config({ graph: g, auth: { rules: rules => { rules.public() }, }, })

Make sure you're using the latest Grafbase CLI when working locally — @0.23.0

  • Fixes an issue where login and logout could only be run in projects
  • Fixes an issue where create would not ask project info if run without parameters
  • Fixes Windows environment variables generation
  • Default to y in the create confirmation prompt
  • Creates $PROJECT/.grafbase if it does not exist when linking
  • Allows connector types to be extended (Grafbase Database)
  • Doesn't error on missing nullable objects in the GraphQL connector
  • Fixes a possible internal error when unlinking entities (Grafbase Database)
  • Removes the fallback to $PROJECT/.grafbase as the home directory if no specific home directory is specified and the user home directory can not be found
  • Fixes OIDC discovery URL handling containing path, enabling using Azure AD
  • Fixes an issue with live queries
  • Fixes a panic when running login and logout
  • Allows setting the location of the configuration directory by either setting --home (gb --home path/to/dir dev / login / create / ...) or the GRAFBASE_HOME environment variable
  • Stops manually initializing the environment when running reset

We'd love to hear your feedback and ideas, so join us on Discord.