-
Notifications
You must be signed in to change notification settings - Fork 426
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
Add support for @sanity-typegen-ignore to ignore queries #6578
Add support for @sanity-typegen-ignore to ignore queries #6578
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@largis21 is attempting to deploy a commit to the Sanity Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice addition that unlocks a few use cases for us, thanks! Have some feedback to just improve the experience
packages/@sanity/codegen/src/typescript/__tests__/findQueriesInSource.test.ts
Show resolved
Hide resolved
Awesome! Can you rebase |
f95582e
to
c7d09a6
Compare
Should be up to date now |
c7d09a6
to
86c3235
Compare
Hi! So sorry I missed your update, but are you OK with doing another rebase/merge? |
86c3235
to
864a1c3
Compare
Up to date again now :) |
864a1c3
to
9622e59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Description
Added functionality in
findQueriesInSource.ts
to ignore queries which are prefixed with the comment@sanity-typegen-ignore
.In some cases you want to extract a single use query to its own value:
Now if you validate the posts with zod you will have to explicitly write the result anyway
What to review
If there are any other cases than the ones specified in the function
getDeclarationLeadingComment
, please let me know and I will add themTesting
Added tests for const declarations, export const and making sure it chooses the correct comment if there are multiple leading comments
Notes for release