-
Notifications
You must be signed in to change notification settings - Fork 16
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
groq-builder: Added q.fragment
implementation
#250
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
carbonrobot
approved these changes
Jan 10, 2024
Merged
scottrippey
added a commit
that referenced
this pull request
Jan 18, 2024
* feature(conditionals): added conditional type helpers * feature(conditionals): implemented the `conditional$` method * feature(conditionals): implemented `conditionalByType` method * feature(conditionals): ensure conditionals can be spread into projections * feature(conditionals): use custom tagged types * feature(conditionals): `filterByType` can accept multiple types * feature(conditionals): improved handling of `indent` * feature(conditionals): implemented conditionals * feature(conditionals): implemented `select` method * feature(conditionals): removed select's "callback" signature * feature(conditionals): added type tests * feature(conditionals): created "root projection" test * feature(conditionals): added test for projection + validatio * feature(conditionals): added import for select method * feature(conditionals): use Empty for RootResult * feature(conditionals): implemented `selectByType` * feature(conditionals): fixed type errors * feature(conditionals): implemented "default" parameter * feature(conditionals): added tests for validation * feature(conditionals): added support for non-callback signature * feature(conditionals): added jsdocs * feature(conditionals): changed signature for conditional projections; uses 2nd parameter * feature(conditionals): added shape validation to assist with projection validations * feature(conditionals): refactored `project` to utilize object shape * groq-builder: Added `q.fragment` implementation (#250) * feature(fragment): added `q.fragment` implementation * feature(fragment): added tests for fragment queries * feature(fragment): ensure we export `Fragment` and `InferFragmentType` types * feature(fragment): added docs * feature(validation): fixed broken import --------- Co-authored-by: scottrippey <scott.william.rippey@gmail.com> * feature(conditionals): added `IGroqBuilder` for easier circular references * feature(conditionals): improve `EntriesOf` * feature(conditionals): updated `Conditional` signature again, to ensure unique, spreadable keys * feature(conditionals): updated implementation of `conditional$` * feature(conditionals): added tests for conditionals within fragments * feature(conditionals): added tests for multiple conditionals * feature(conditionals): improved multiple-conditional intersection types * feature(conditionals): added CONDITIONALS docs * feature(conditionals): made `key` a configuration option * feature(conditionals): added an "exhaustive" check for conditionals * feature(conditionals): updated CONDITIONALS docs * feature(conditionals): added docs on Select function * feature(conditionals): added more examples for `q.select` * feature(conditionals): added jsdocs for ConditionalConfig * feature(conditionals): fixed validation error formatting * feature(conditionals): updated conditional tests * feature(conditionals): removed debugging code * feature(conditionals): fixed EntriesOf implementation * feature(conditionals): fixed type param of no-arg versions of `validation.object()` and `validation.array()` * feature(conditionals): removed unused imports --------- Co-authored-by: scottrippey <scott.william.rippey@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented
q.fragment
method for defining reusable fragments.Examples
Defining a fragment:
Consuming a fragment
You can pass to
project
:You can spread inside a
project
:You can compose multiple fragments by spreading.
TODO