CLI and OpenAPI Connector Improvements

CLI and OpenAPI Connector Improvements

The Grafbase CLI now makes it easier to create projects with the addition of new flags.

We introduced CLI Deploys last month which prompted you to provide the project name, account or organization, and region.

In the latest release 0.19.2 you can now pass the following flags when creating a project:

  • -n, --name <name> — The name for the new project
  • -a, --account <slug> — The slug of the account in which the new project should be created
  • -r, --regions <region> — The regions in which the database for the new project should be created

We've also made it easier to create and deploy projects inside CI environments with the newly supported GRAFBASE_ACCESS_TOKEN system environment variable.

GRAFBASE_ACCESS_TOKEN=... npx grafbase deploy

This environment is not to be confused with those environment variables supported inside grafbase/.env.

  • The @openapi directive no longer requires the url parameter if the schema contains a URL.
  • @openapi now supports OpenAPI v2.
  • @openapi now accepts schema headers with the new parameter introspectionHeaders
  • Reduced memory when dealing with introspection queries.
  • Defaults on OpenAPI enumerations now work correctly.
  • @openapi schemas containing the JSON scalar now work correctly.
  • Fixed an issue with the "by ID" query and with owner based auth.
  • Improves the error message wording when users are logged out.
  • The watcher now correctly allows server errors to be emitted and stop the reload loop.
  • Resolvers now emit error logs on exceptions.
  • Union types generated by @openapi now return the correct typename.
  • Fragment selections on union types generated by @openapi now return data.
  • @openapi unions generated from oneOf or anyOf schemas containing a scalar now expose that scalar as one of the variants of the union.
  • Fix auto-generated update mutation for @model types with @default fields. The mutation would previously re-apply the default values and break in some cases.
  • Input objects used by custom resolvers no longer removed from the final schema.
  • The parent argument to custom resolvers is now populated in by ID queries.
  • The OpenAPI connector now supports shared operation parameters.
  • The OpenAPI connector now supports more HTTP methods.
  • Fixes a panic for invalid identifiers during OIDC verification.

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