I tried the new @[email protected] `getContext` Node API, to see if I could display some posts in @[email protected] without the need to use the GraphQL API.

With the Query API that wraps @[email protected], I can use Keystone's Admin UI to create content, and generate Astro pages at build time.

When there's no need to fetch data client side, this Query API is much nicer to interface with than doing a fetch POST request + passing the GraphQL query in the body of the request.

This is so sweet.

The best part? No need for the API server to run.

No need to host Keystone!

You can learn more about the Keystone getContext API here:

https://keystonejs.com/docs/context/get-context.

Get Context - Keystone 6 Documentation

getContext is a function exported by @keystone-6/core/context to support operations without starting a HTTP server

Get Context - Keystone 6 Documentation

And the documentation on the Query API is available here:

https://keystonejs.com/docs/context/query

Query - Keystone 6 Documentation

Reference docs for Keystone‘s Query API: a programmatic API for running CRUD operations against your GraphQL API.

Query - Keystone 6 Documentation

Keystone was already awesome as it was, but this takes it to another level.

Not having to worry about deploying/hosting the Keystone API is game-changing for frontenders like me 😅

Particularly when building static sites with Astro 🚀

Kudos to the @[email protected] team ❤️

@simonswiss
Am I right that you're using Keystone locally more or less as a nicer interface to create content? Do you run everything in one repo (Astro, Keystone), including database as e.g. SQLite?
Interesting approach, definitely. Not usable for client work (as we would need to deploy Keystone there :)), but besides that: Cool!