[day-03] create root type to define queries
Expose the query to get a specific user.
This commit is contained in:
parent
289901b0c9
commit
b7cbcbd51f
15
lib/wabanex_web/schema/types/root.ex
Normal file
15
lib/wabanex_web/schema/types/root.ex
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
defmodule WabanexWeb.Schema.Types.Root do
|
||||||
|
use Absinthe.Schema.Notation
|
||||||
|
|
||||||
|
alias WabanexWeb.Resolvers.User, as: UserResolver
|
||||||
|
|
||||||
|
import_types WabanexWeb.Schema.Types.User
|
||||||
|
|
||||||
|
object :root_query do
|
||||||
|
field :get_user, type: :user do
|
||||||
|
arg :id, non_null(:uuid4)
|
||||||
|
|
||||||
|
resolve &UserResolver.get/2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user