-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9622781
commit 3b8127d
Showing
11 changed files
with
29 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
[ | ||
import_deps: [:ecto, :phoenix], | ||
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"], | ||
subdirectories: ["priv/*/migrations"] | ||
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
defmodule SchlusseliWeb.Resolvers.Customer do | ||
|
||
alias Schlusseli.Factory | ||
|
||
def list_customers(_parent, _args, %{context: %{claims: _context}}) do | ||
{:ok, Factory.build_list(10, :customer)} | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
defmodule SchlusseliWeb.Resolvers.Key do | ||
|
||
alias Schlusseli.Factory | ||
|
||
def list_keys(_parent, _args, _resolution) do | ||
{:ok, Factory.build_list(10, :key)} | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
defmodule SchlusseliWeb.Schema do | ||
use Absinthe.Schema | ||
|
||
import_types SchlusseliWeb.Schema.KeyTypes | ||
import_types SchlusseliWeb.Schema.CustomerTypes | ||
import_types(SchlusseliWeb.Schema.KeyTypes) | ||
import_types(SchlusseliWeb.Schema.CustomerTypes) | ||
|
||
alias SchlusseliWeb.Resolvers | ||
|
||
query do | ||
|
||
@desc "Get all keys" | ||
field :keys, list_of(:key) do | ||
resolve &Resolvers.Key.list_keys/3 | ||
resolve(&Resolvers.Key.list_keys/3) | ||
end | ||
|
||
@desc "Get all customers" | ||
field :customers, list_of(:customer) do | ||
middleware SchlusseliWeb.Schema.Middleware.Authorize, "view_customers" | ||
resolve &Resolvers.Customer.list_customers/3 | ||
middleware(SchlusseliWeb.Schema.Middleware.Authorize, "view_customers") | ||
resolve(&Resolvers.Customer.list_customers/3) | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.