소개
Designed to give the best GROQ developer experience possible, with the flexibility of GROQ, schema-aware auto-completion, strong type-checking, and the runtime safety of Zod.
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalCheck 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 }[] }[]
// 👆👆
Support
Have a question about Groqd? Submit an issue in this repository using the "Question" template.
Notice something inaccurate or confusing? Feel free to open an issue or make a pull request to help improve the documentation for everyone!
The source for our docs site lives in this repo in the docs folder.
Contributing
Please see our contributing guide.
Maintenance Status
Active: Nearform is actively working on this project, and we expect to continue for work for the foreseeable future. Bug reports, feature requests and pull requests are welcome.
관련 프로젝트 살펴보기
불러오는 중…