Skip to content

Commit

Permalink
Change Schema names to plural
Browse files Browse the repository at this point in the history
  • Loading branch information
abshierjoel committed Oct 3, 2021
1 parent 9537691 commit b6339aa
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions lib/gql_preferences_web/schema.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
defmodule UserPreferencesWeb.Schema do
use Absinthe.Schema
alias UserPreferences.{User, Preference, Repo}

query do
field :user, list_of(:user) do
resolve fn _, _, _ ->
{:ok, Repo.all(User)}
end
end

field :preference, list_of(:preference) do
resolve fn _, _, _ ->
{:ok, Repo.all(Preference)}
end
end
end

mutation

object :user do
field :id, :id
field :name, :string
field :email, :string
end

object :preference do
field :likes_emails, :boolean
field :likes_phone_calls, :boolean
end
end

0 comments on commit b6339aa

Please sign in to comment.