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

Global Context for Load/Calculcations #1517

Open
allenwyma opened this issue Oct 14, 2024 · 0 comments
Open

Global Context for Load/Calculcations #1517

allenwyma opened this issue Oct 14, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@allenwyma
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When loading multiple resources, it'd be great to pass in a shared context to help alleviate complexity. I.E. a context for loading calculations.

Describe the solution you'd like
I'd like to be able to set the context: %{global: %{locale: "en"}}, and this will be merged with further context and available to me in calculations.

Describe alternatives you've considered
Right now, the alternative is I need to specifically set the query for the join relation, but this can be cumbersome if i'm joining a lot of resources.

Express the feature either with a change to resource syntax, or with a change to the resource interface

For example

Ash.read!(Post, load: [:name, comments: [:name], context: %{global: %{locale: "en"}})

Additional context
#1516

@allenwyma allenwyma added enhancement New feature or request needs review labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants