Support field?: false calculations in GraphQL schema#446
Open
jaylynntautu wants to merge 3 commits into
Open
Conversation
Contributor
|
So we actually can support these as fields in GraphQL, they just have to be picked from |
Contributor
|
Maybe we should make that opt-in somehow though 🤔 |
Contributor
Author
|
Ohhh okay I followed the original issue description and excluded them from the response schema while keeping filter/sort support. Since they can still be resolved through |
Contributor
|
Yes please 🙇 |
Contributor
|
Although, I think what we should do is hide them from the GraphQL by default and add a new DSL option to include them. Like |
This file contains hidden or 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
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.
Contributor checklist
Leave anything that you believe does not apply unchecked.
Summary
This updates GraphQL response schema generation to respect Ash calculations using
field?: false.Calculations marked with
field?: falseare now excluded from normal GraphQL response fields while still remaining available in filter and sort schema generation.Changes
Updated
calculations/3inlib/resource/resource.exto exclude calculations wherefield?is falseReplaced the old read test that allowed querying
nonFieldCalcAdded regression tests confirming:
field?: falsecalculations are not exposed on thePostresponse typefield?: falsecalculations are still included inPostFilterInputfield?: falsecalculations are still included inPostSortFieldVerification
Ran locally:
mix testmix format --check-formattedmix credo --strictFull test suite passing locally: