GraphQL for AT Protocol
JavaScript 84.5%
TypeScript 15.3%
HTML 0.1%
Dockerfile 0.1%
CSS 0.1%
47 1 0

Clone this repository

https://tangled.org/chadtmiller.com/lex-gql
git@tangled.org:chadtmiller.com/lex-gql

For self-hosted knots, clone URLs may differ based on your setup.

README.md

lex-gql#

GraphQL for AT Protocol. Generate a complete GraphQL API from AT Protocol lexicons.

⚠️ Experimental ⚠️ - This project is under active development. APIs may change and there are probably bugs.

import { parseLexicon, createAdapter } from 'lex-gql';

const adapter = createAdapter(
  [parseLexicon(postLexicon), parseLexicon(profileLexicon)],
  {
    query: async (op) => db.execute(op),
  }
);

const result = await adapter.execute(`
  query {
    appBskyFeedPost(first: 10, where: { text: { contains: "hello" } }) {
      edges {
        node {
          uri
          text
          appBskyActorProfileByDid {
            displayName
          }
        }
      }
    }
  }
`);

Features#

  • Relay-style pagination
  • Automatic joins between collections (forward, reverse, and DID-based)
  • Filtering, sorting, and aggregations
  • CRUD mutations
  • Subscriptions
  • Batched join resolution (no N+1)

Packages#

Examples#

  • jetstream - Real-time subscriptions with AT Protocol Jetstream
  • tap - GraphQL queries with AT Protocol tap

License#

MIT