datasette-graphql 3.1a0 Released: Permission-Aware Queries and GraphiQL Upgrade

datasette-graphql 3.1a0 adds permission-aware queries, upgrades GraphiQL, and supports Datasette Lite.
Simon Willison released datasette-graphql 3.1a0, a practical update to the GraphQL endpoint plugin for Datasette. The core improvement is that GraphQL queries now execute as the currently logged-in user—whether via Cookie session or API Token—so the plugin correctly identifies the actor identity, enabling GraphQL queries against permission-protected instances and tables and bridging the previous disconnect with Datasette's permission system. The built-in GraphiQL is upgraded from 1.5.1 to 4.1.2; because GraphiQL 5/6 switched to Monaco, which lacks sufficient mobile support, the author chose a compromise version. It also fixes endpoint sending under base_url subpath deployments, supports live demos in Datasette Lite so the README can embed clickable online examples, and raises the minimum dependency to Datasette 1.0a47.

Simon Willison has released datasette-graphql 3.1a0, a significant update to the GraphQL API endpoint plugin for Datasette. The core improvements in this release center on permission integration, a GraphiQL interface upgrade, and support for Datasette Lite. For users who need to access authenticated datasets via GraphQL, the practical utility has clearly improved.
Core Change: GraphQL Queries Execute as the Logged-In User
The most notable feature in this update is that GraphQL queries now run as the currently logged-in user. This means that when a Datasette instance or table is configured with access authentication, GraphQL queries work correctly as well—whether through a browser session logged in via Cookie or programmatic access using an API Token, the plugin can properly identify the actor identity.
Previously, there was a disconnect between the GraphQL endpoint and Datasette's permission system, and protected resources could not be queried normally through GraphQL. This change (issue #97) bridges the two, making datasette-graphql usable in production scenarios that require permission control rather than being limited to public data demos.
Datasette's permission model is based on the "actor" concept: each request resolves to an actor object (anonymous or authenticated), and plugins determine whether to allow access through interfaces such as datasette.permission_allowed(actor, ...). Previously, when datasette-graphql parsed GraphQL queries, it did not pass the current request's actor to the underlying table query logic, causing permission checks to degrade to anonymous identity, so protected tables returned empty results or errors. The change in 3.1a0 essentially connects the identity-passing chain between the request context and the GraphQL resolver, so that each GraphQL field resolution can carry the correct actor for permission determination. This mechanism also applies to API Token access, because Datasette's Token authentication middleware completes actor injection before the request enters the plugin.
GraphiQL Jumps from 1.5.1 to 4.1.2
The plugin's built-in GraphiQL query interface has been upgraded from 1.5.1 to 4.1.2 (PR #106), a fairly large jump. The new GraphiQL offers clear improvements in interaction experience and feature completeness.
The author explained in the release notes why it stopped at this version: GraphiQL 5 and 6 switched the code editor from CodeMirror to Monaco, and Monaco currently has no mature solution for running on mobile. Therefore 4.1.2 is a compromise between functionality and mobile compatibility. This detail also indirectly shows that the plugin still takes mobile browsing experience into consideration.
GraphiQL is the in-browser query IDE from the official GraphQL ecosystem, offering syntax highlighting, autocompletion, documentation browsing, and query history. Its 1.x series was built on older React and CodeMirror 5; the 4.x series underwent multiple architectural adjustments and significantly improved completion quality, variable editors, and response display. CodeMirror and Monaco are two mainstream browser code editors: the former is lightweight, modular, and mature in mobile adaptation; the latter is the core of VS Code, powerful but large and with weaker touch interaction support. GraphiQL switched to Monaco starting with version 5, which explains why the plugin stays at 4.1.2—for Datasette users who primarily access via browser, mobile usability matters more than editor feature depth.
base_url and Datasette Lite Support
Another practical fix: when Datasette runs with a base_url (i.e., deployed under a subpath), GraphiQL now sends queries to the correct endpoint. This fix also covers Datasette Lite—a variant of Datasette that runs entirely in the browser.
The direct benefit of this change is that the author can embed clickable live demo links directly in the README without running a separate server for each example. For instance, the README now includes an online demo that executes GraphQL queries against a GitHub database; users can click to load the plugin in Datasette Lite and run the query. For an open-source project's documentation experience, this is a significant plus.
base_url is a Datasette configuration that allows an instance to be mounted under a subpath of a domain (e.g., https://example.com/mydata/) rather than the root path. In this case, all internal links and API endpoints must include that prefix; otherwise, requests sent by the frontend point to the wrong address. As an independent frontend page, GraphiQL needs to know the current instance's base_url to construct the correct GraphQL endpoint URL—this was exactly the issue fixed previously. Datasette Lite is a version compiled to WebAssembly that runs entirely in the browser, with data loaded via URL parameters and no dependency on a backend server. Combined, demo links in the README can directly carry base_url and data source parameters, and clicking them launches an interactive Datasette instance locally in the browser.
Version Dependencies and Upgrade Advice
This release raises the minimum dependency to Datasette 1.0a47 or higher. Users still running older versions of Datasette need to upgrade the main program before using this plugin version. Given that the Datasette 1.0 series is still in alpha, this requirement is consistent with the plugin following the main program's evolution.
For developers already using datasette-graphql, if the datasets involve permission control or are deployed under a subpath, 3.1a0 is worth trying first. If it is only used for local public data exploration, the urgency to upgrade is relatively low, but the GraphiQL interface improvements still bring a better user experience.
Summary
datasette-graphql 3.1a0 is a practicality-oriented iteration: permission awareness makes the plugin truly usable for protected data services, the GraphiQL upgrade improves the usability of the query interface, and the base_url fix and Datasette Lite support expand the plugin's applicability. For teams building GraphQL interfaces on top of Datasette, this is a release worth noting.
Related articles

Should You Flake on a Friend? Five Questions to Help You Decide
Should you cancel plans with a friend? Vox's Allie Volpe offers five weighing questions: who you're flaking on, the occasion, how much trouble it is to attend, whether your reason holds up, and the consequences—helping you make a more responsible decision before you send that message.

OpenSSH Adds Support for Composite ML-DSA 87 / ECDSA p384 Keys
OpenSSH commits support for composite ML-DSA 87 and ECDSA p384, combining post-quantum signatures with classic elliptic curve algorithms.

Why Editors Should Reject Bad AI-Written Academic Papers
Hacker News viewpoint argues editors should reject bad AI-written academic papers based on manuscript quality, not AI usage. Analysis of this stance's rationale, practical challenges, and the quality baseline in academic publishing.