ALL INTELLIGENCE
Simon Willison 博客T2·Tools

datasette-graphql 3.1a0 Adds Authenticated GraphQL Queries

Original title: datasette-graphql 3.1a0
38AI Score

datasette-graphql 3.1a0 now runs GraphQL queries as the signed-in actor, enabling access to authenticated instances and tables via cookie or API token. It also upgrades bundled GraphiQL from 1.5.1 to 4.1.2, fixes endpoint routing under base_url and Datasette Lite, and requires Datasette 1.0a47 or later.

Full Report

Release: datasette-graphql 3.1a0

The most notable features in this release for the Datasette GraphQL API endpoint plugin:

  • GraphQL queries now run as the signed-in actor, so they work on instances and tables that require authentication - whether the actor signed in with a cookie or an API token. #97
  • Upgraded the bundled GraphiQL from 1.5.1 to 4.1.2. #106
  • GraphiQL now sends queries to the correct endpoint when Datasette is running with a base_url, including in Datasette Lite. #106
  • Now requires Datasette 1.0a47 or later.

Getting GraphiQL working with Datasette Lite was worthwhile because it means I can now link to live demos of different queries without needing to run a dedicated server. The README has links to those in a bunch of places now, for example this one.

I had to bump to GraphiQL 4.1.2 but no later because GraphiQL versions 5 and 6 switch CodeMirror out for Monaco, and Monaco still doesn't have a good story for running on a mobile phone.

Tags: datasette, graphql