返回全部资讯
Simon Willison 博客T2·开发与工程

datasette-graphql 3.1a0 支持鉴权查询

原标题:datasette-graphql 3.1a0
38AI 研判分

datasette-graphql 发布 3.1a0 版本,GraphQL 查询现在以已登录 actor 身份执行,可访问需要认证的实例与数据表,并支持 Cookie 与 API Token 两种登录方式。同时内置 GraphiQL 从 1.5.1 升级至 4.1.2,修复了 base_url 与 Datasette Lite 下的端点指向问题,最低要求 Datasette 1.0a47。

报道正文

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