Feat/add manifest filtering and sorting#2704
Merged
Merged
Conversation
zachdaniel
reviewed
May 17, 2026
|
|
||
| # Heuristic: lowercase, non-Elixir atom is a builtin (`:string`, `:integer`, ...). | ||
| # Modules start with uppercase (`Ash.Type.Integer`). | ||
| defp builtin_type?(atom) do |
Contributor
There was a problem hiding this comment.
Not a good heuristic, as people can add their own custom types. We should always get types from Ash.Type.get_type to turn any value into its proper type module. If you need to know if it's a builtin there is a function IIRC called Ash.Type.builtin?/1
zachdaniel
reviewed
May 17, 2026
|
|
||
| defp concrete_ref(ref) do | ||
| case Atom.to_string(ref) do | ||
| "Elixir." <> _ -> module_to_string(ref) |
Contributor
There was a problem hiding this comment.
You can inspect(ref) if it's an atom? Or if its a module?
…esolution Adds a global operator/function/custom-expression catalog plus per-field Applicable* lists with resolved rhs types. Relationships keep filterable?/sortable? booleans; consumers derive filter/sort shape from cardinality. Aggregate allow_nil? now derives from kind.
823b361 to
b1236d5
Compare
Contributor
|
🚀 Thank you for your contribution! 🚀 |
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.
Summary
Extends
Ash.Info.Manifestwith the filter/sort vocabulary needed by code-gen consumers (e.g. ash_graphql, ash_typescript) so they no longer have to re-derive it from raw Ash internals.Top-level catalog (
%FilterCapabilities{},%SortCapabilities{}):Per-field resolution on every
%Field{}:filter_operators,filter_functions,filter_custom_expressions— lists of%Applicable*{}records pairing each applicable name with its resolved rhs type (:same,:any,{:concrete, t},{:array, t})<,>,<=,>=) trimmed for arrays and booleansPer-relationship:
filterable?/sortable?booleans replaced withfilterable_via(:traversal|:exists|false) andsortable_via(:traversal|false) tagged atoms reflecting cardinality — one-cardinality relationships can be dot-traversed, many-cardinality need an existential quantifier. Fields keep their booleans (no cardinality distinction applies).Aggregate fix:
%Field{kind: :aggregate}.allow_nil?now derives from aggregate kind (:count/:exists/:list→ false;:first/:max/:min/:sum/:avg→ true) instead of the unrelated:include_nil?input flag.Contributor checklist
Leave anything that you believe does not apply unchecked.