Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive schemas #322

Open
2 tasks done
maxijonson opened this issue Jan 16, 2025 · 0 comments
Open
2 tasks done

Recursive schemas #322

maxijonson opened this issue Jan 16, 2025 · 0 comments

Comments

@maxijonson
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature Request

It would be nice to support recursive schemas like how Zod [handles them with z.lazy](https://zod.dev/?id=recursive-types).

I'm able to make this recursion in the Sanity schema, but having a hard time building the query with groqd (if that's even possible).

Right now, I would just query the whole field with `subcategories: q("subcategories")` and parse it manually with Zod as a second step, after running the query.

It's worth noting I'm currently on v0, but could explore upgrading to v1 if it's not possible in v0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant