-
-
Notifications
You must be signed in to change notification settings - Fork 321
feat: Exclude resource calculations from resource struct with field?: false
option
#2250
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
base: main
Are you sure you want to change the base?
Conversation
20998d2
to
16cf732
Compare
field?: false
option to Ash.Resource.Calculation DSLfield?: false
option
12f49e6
to
3246d93
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.
LGTM! Lets add that test and ship.
ok, the validation is in and you now get an |
4cbdc85
to
629f001
Compare
Just had a thought: we may actually have a bit of an issue here 😢 Specifically, AshGraphql and AshJsonApi will need to be updated to support this, by not allowing loads for these non-loadable calculations. We'll want PRs for those done before we release this. |
No experience with those packages, but I'll take a look at them. |
Both api libraries only expose Do you see any cases where a |
Hmm...yes. It could be supported in filters exposed over GraphQL for example without being exposed as a field. |
5c873aa
to
773c2ee
Compare
773c2ee
to
55b53d4
Compare
Improvements
field?
option toAsh.Resource.Calculation
DSLfield?: false
calculations from Resource struct and direct loading, but still usable in expressionsAsh.Error.InvalidLoad
error when loading afield?: false
calculation directlyfield?
optionWe could probably do the same for aggregates once this is done.
#2242
Contributor checklist
Leave anything that you believe does not apply unchecked.