Skip to content

About

Import .groq files as typed query strings, powered by a TypeScript 7.1 content mapper

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

groq-content-mapper

Typed .groq file imports for TypeScript 7.1 and later, from your Sanity schema.

import postsBySearch, {type QueryResponse} from './postsBySearch.groq'

See packages/groq-content-mapper for usage and setup.

Development

pnpm install
pnpm build
pnpm test
pnpm lint

packages/groq-content-mapper/wasm is the build of the Rust crate in packages/groq-content-mapper/rust, which parses GROQ with groq-parser. It is committed, so only a change to the crate needs Rust: pnpm --filter @sanity-labs/groq-content-mapper build:wasm rebuilds it with the toolchain rust/rust-toolchain.toml pins and wasm-bindgen-cli at the version rust/Cargo.toml pins. CI rebuilds it and fails on a difference.

Every user-facing change needs a changeset: run pnpm changeset and commit the file it writes. Merging to main opens or updates the release PR, and merging that publishes to npm.

About

Import .groq files as typed query strings, powered by a TypeScript 7.1 content mapper

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages