bext-plugin-graphql

GraphQL endpoint with schema stitching and persisted queries.

$ bext plugin add graphql
Version 2.2.0
Sandbox nsjail
Author nate-rivers
License MIT
Downloads 4,817
Updated 2026-03-18

Serves a GraphQL API from your bext app. Supports schema stitching (combine multiple schemas), automatic persisted queries (APQ), and an embedded playground UI for development.

Install

bext plugin add graphql

Config

[plugins.graphql]
path = "/graphql"
playground = true          # disable in production
persisted_queries = true
schema = "src/schema.graphql"

Schema

Define your schema in a `.graphql` file:

type Query {
  user(id: ID!): User
  posts(limit: Int = 10): [Post!]!

type User { id: ID! name: String! email: String! }

type Post { id: ID! title: String! body: String! author: User! } ```

Resolvers

Export resolvers from `src/resolvers.ts`:

export const resolvers = {
  Query: {
    user: (_, { id }) => db.users.findById(id),
    posts: (_, { limit }) => db.posts.findMany({ take: limit }),
  },
};

Persisted queries

When enabled, the plugin accepts query hashes instead of full query strings. On the first request with a hash, the client sends the full query and the plugin caches it. Subsequent requests only send the hash, reducing bandwidth.