0.15.11 • Published 20 days ago

groqd v0.15.11

Weekly downloads
-
License
MIT
Repository
github
Last release
20 days ago

GROQD — Formidable, We build the modern web

Check out the official documentation.

groqd is a schema-unaware, runtime-safe query builder for GROQ. The goal of groqd is to give you (most of) the flexibility of GROQ, with the runtime/type safety of Zod and TypeScript.

groqd works by accepting a series of GROQ operations, and generating a query to be used by GROQ and a Zod schema to be used for parsing the associated GROQ response.

An illustrative example:

import { q } from "groqd";

// Get all of the Pokemon types, and the Pokemon associated to each type.
const { query, schema } = q("*")
  .filter("_type == 'poketype'")
  .grab({
    name: q.string(),
    pokemons: q("*")
      .filter("_type == 'pokemon' && references(^._id)")
      .grab({ name: q.string() }),
  });

// Use the schema and the query as you see fit, for example:
const response = schema.parse(await sanityClient.fetch(query));

// At this point, response has a type of:
// { name: string, pokemons: { name: string }[] }[]
// 👆👆
0.15.11

20 days ago

0.15.10

6 months ago

0.15.6

12 months ago

0.15.7

11 months ago

0.15.8

9 months ago

0.15.9

9 months ago

0.15.4

1 year ago

0.15.5

12 months ago

0.15.0

1 year ago

0.15.1

1 year ago

0.15.2

1 year ago

0.15.3

1 year ago

0.11.0

1 year ago

0.12.0

1 year ago

0.13.0

1 year ago

0.14.0

1 year ago

0.13.1

1 year ago

0.10.0

1 year ago

0.9.0

1 year ago

0.8.0

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago

0.7.0

1 year ago

0.3.0

1 year ago

0.6.3

1 year ago

0.6.2

1 year ago

0.5.0

1 year ago

0.4.1

1 year ago

0.3.2

1 year ago

0.4.0

1 year ago

0.3.1

1 year ago

0.6.1

1 year ago

0.5.2

1 year ago

0.6.0

1 year ago

0.5.1

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.5

1 year ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago