Skip to content

Commit 43c00df

Browse files
author
Chris Martin
committed
Disable all guards.
1 parent 98d8b0f commit 43c00df

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

lib/cqrs/absinthe.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ if Code.ensure_loaded?(Absinthe) do
278278

279279
@doc false
280280
def ensure_is_schema!(module) do
281-
unless Guards.exports_function?(module, :__schema__, 2) do
282-
raise Cqrs.Absinthe.InvalidSourceError, module: module
283-
end
281+
# unless Guards.exports_function?(module, :__schema__, 2) do
282+
# raise Cqrs.Absinthe.InvalidSourceError, module: module
283+
# end
284284
end
285285
end
286286
end

lib/cqrs/guards.ex

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ defmodule Cqrs.Guards do
33
alias Cqrs.{InvalidCommandError, InvalidDispatcherError, InvalidQueryError}
44

55
def ensure_is_struct!(module) do
6-
unless exports_function?(module, :__struct__, 0) do
7-
raise "#{module |> Module.split() |> Enum.join(".")} should be a valid struct."
8-
end
6+
# unless exports_function?(module, :__struct__, 0) do
7+
# raise "#{module |> Module.split() |> Enum.join(".")} should be a valid struct."
8+
# end
99
end
1010

1111
def ensure_is_command!(module) do
12-
unless exports_function?(module, :__command__, 0) do
13-
raise InvalidCommandError, command: module
14-
end
12+
# unless exports_function?(module, :__command__, 0) do
13+
# raise InvalidCommandError, command: module
14+
# end
1515
end
1616

1717
def ensure_is_query!(module) do
18-
unless exports_function?(module, :__query__, 0) do
19-
raise InvalidQueryError, query: module
20-
end
18+
# unless exports_function?(module, :__query__, 0) do
19+
# raise InvalidQueryError, query: module
20+
# end
2121
end
2222

2323
def ensure_is_dispatcher!(module) do
24-
unless exports_function?(module, :dispatch, 2) do
25-
raise InvalidDispatcherError, dispatcher: module
26-
end
24+
# unless exports_function?(module, :dispatch, 2) do
25+
# raise InvalidDispatcherError, dispatcher: module
26+
# end
2727
end
2828

2929
def exports_function?(module, fun, arity) do

lib/cqrs/metadata.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ defmodule Cqrs.Metadata do
66

77
def put_default_metadata(opts) do
88
metadata = get_metadata()
9+
# |> IO.inspect(label: "default metadata")
910

1011
Keyword.update(opts, :metadata, metadata, fn existing_metadata ->
12+
# existing_metadata |> IO.inspect(label: "existing_metadata")
13+
1114
Map.merge(metadata, existing_metadata)
15+
# |> IO.inspect(label: "metadata")
1216
end)
1317
end
1418

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule CqrsTools.MixProject do
22
use Mix.Project
33

4-
@version "0.5.26"
4+
@version "0.5.27"
55

66
def project do
77
[

0 commit comments

Comments
 (0)