{"id":26641562,"url":"https://github.com/formidablelabs/groqd","last_synced_at":"2025-05-15T04:04:45.198Z","repository":{"id":62461124,"uuid":"559586240","full_name":"FormidableLabs/groqd","owner":"FormidableLabs","description":"A schema-unaware, runtime and type-safe query builder for GROQ.","archived":false,"fork":false,"pushed_at":"2025-05-08T08:00:36.000Z","size":7804,"stargazers_count":261,"open_issues_count":11,"forks_count":17,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-05-11T08:06:07.142Z","etag":null,"topics":["groq","typescript","zod"],"latest_commit_sha":null,"homepage":"https://commerce.nearform.com/open-source/groqd","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FormidableLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-30T15:21:16.000Z","updated_at":"2025-05-10T18:09:51.000Z","dependencies_parsed_at":"2023-02-15T17:31:22.218Z","dependency_job_id":"506c4d97-8f9b-40aa-8920-47fa88bb2841","html_url":"https://github.com/FormidableLabs/groqd","commit_stats":{"total_commits":236,"total_committers":18,"mean_commits":13.11111111111111,"dds":"0.35593220338983056","last_synced_commit":"cdb4acbeaba09d9a51a48af1c413aeaf0a3bd47e"},"previous_names":[],"tags_count":94,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormidableLabs%2Fgroqd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormidableLabs%2Fgroqd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormidableLabs%2Fgroqd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormidableLabs%2Fgroqd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FormidableLabs","download_url":"https://codeload.github.com/FormidableLabs/groqd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270641,"owners_count":22042858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["groq","typescript","zod"],"created_at":"2025-03-24T18:32:01.564Z","updated_at":"2025-05-15T04:04:45.171Z","avatar_url":"https://github.com/FormidableLabs.png","language":"TypeScript","readme":"[![GROQD](https://oss.nearform.com/api/banner?badge=groqd\u0026bg=c99f46)](https://commerce.nearform.com/open-source/groqd)\n\n**[Check out the official documentation.](https://commerce.nearform.com/open-source/groqd)**\n\n`groqd` is a schema-unaware, runtime-safe query builder for [GROQ](https://www.sanity.io/docs/groq). **The goal of `groqd` is to give you (most of) the flexibility of GROQ, with the runtime/type safety of [Zod](https://github.com/colinhacks/zod) and TypeScript.**\n\n`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.\n\nAn illustrative example:\n\n```ts\nimport { q } from \"groqd\";\n\n// Get all of the Pokemon types, and the Pokemon associated to each type.\nconst { query, schema } = q(\"*\")\n  .filter(\"_type == 'poketype'\")\n  .grab({\n    name: q.string(),\n    pokemons: q(\"*\")\n      .filter(\"_type == 'pokemon' \u0026\u0026 references(^._id)\")\n      .grab({ name: q.string() }),\n  });\n\n// Use the schema and the query as you see fit, for example:\nconst response = schema.parse(await sanityClient.fetch(query));\n\n// At this point, response has a type of:\n// { name: string, pokemons: { name: string }[] }[]\n// 👆👆\n```\n\n## Support\n\nHave a question about Groqd? Submit an issue in this repository using the\n[\"Question\" template](https://github.com/FormidableLabs/groqd/issues/new?template=question.md).\n\nNotice something inaccurate or confusing? Feel free to [open an issue](https://github.com/FormidableLabs/groqd/issues/new/choose) or [make a pull request](https://github.com/FormidableLabs/groqd/pulls) to help improve the documentation for everyone!\n\nThe source for our docs site lives in this repo in the [`docs`](https://github.com/FormidableLabs/groqd/blob/main/website/docs) folder.\n\n## Contributing\n\nPlease see our [contributing guide](CONTRIBUTING.md).\n\n## Maintenance Status\n\n**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.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformidablelabs%2Fgroqd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformidablelabs%2Fgroqd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformidablelabs%2Fgroqd/lists"}