2022-05-10 13:53:01 +12:00
|
|
|
defmodule AshGraphql.Test.NoObject do
|
|
|
|
@moduledoc false
|
|
|
|
|
|
|
|
use Ash.Resource,
|
2024-04-02 07:03:06 +13:00
|
|
|
domain: AshGraphql.Test.Domain,
|
2022-05-10 13:53:01 +12:00
|
|
|
data_layer: Ash.DataLayer.Ets,
|
|
|
|
extensions: [AshGraphql.Resource]
|
|
|
|
|
|
|
|
graphql do
|
|
|
|
generate_object? false
|
2024-03-29 04:16:32 +13:00
|
|
|
|
|
|
|
queries do
|
|
|
|
action :no_object_count, :count
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
actions do
|
|
|
|
defaults([:read, :create])
|
|
|
|
|
|
|
|
action :count, {:array, :integer} do
|
|
|
|
run(fn _input, _context ->
|
|
|
|
{:ok, [1, 2, 3, 4, 5]}
|
|
|
|
end)
|
|
|
|
end
|
2022-05-10 13:53:01 +12:00
|
|
|
end
|
|
|
|
|
|
|
|
attributes do
|
|
|
|
uuid_primary_key(:id)
|
|
|
|
|
2024-04-02 07:03:06 +13:00
|
|
|
attribute(:name, :string, public?: true)
|
2022-05-10 13:53:01 +12:00
|
|
|
end
|
|
|
|
end
|