mirror of
https://github.com/ash-project/ash_graphql.git
synced 2024-09-20 21:32:59 +12:00
28 lines
417 B
Elixir
28 lines
417 B
Elixir
|
defmodule AshGraphql.Test.User do
|
||
|
@moduledoc false
|
||
|
|
||
|
use Ash.Resource,
|
||
|
data_layer: Ash.DataLayer.Ets,
|
||
|
extensions: [AshGraphql.Resource]
|
||
|
|
||
|
graphql do
|
||
|
type :user
|
||
|
|
||
|
queries do
|
||
|
read_one :current_user, :current_user
|
||
|
end
|
||
|
end
|
||
|
|
||
|
actions do
|
||
|
read :current_user do
|
||
|
filter(id: actor(:id))
|
||
|
end
|
||
|
end
|
||
|
|
||
|
attributes do
|
||
|
uuid_primary_key(:id)
|
||
|
|
||
|
attribute(:name, :string)
|
||
|
end
|
||
|
end
|