Ash FrameworkAF
Ash Framework3y ago
55 replies
tommasop#2001

Filter fields to be returned on an Ash.Query and an AshJsonApi route

I'm having a hard time finding out how can I filter returned fields from an Ash.Query this is my code:

    read :quantities do
      description "Product Quantities available in MMS"

      prepare fn query, _ ->
        query
        |> Ash.Query.select([
          :sku_code,
          :quantity
        ])
      end
    end

And I'm supposing it to return only :sku_code and :quantity but it returns all the fields as
nil
and only the two fields with real data.
Is it possible to filter the returned fields?
Thanks a lot
Was this page helpful?