Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Feb 12, 2024
1 parent 99d2d66 commit 21aed2d
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions test/support/resources/channel/channel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,22 @@ defmodule AshGraphql.Test.Channel do
end

calculations do
calculate(:direct_channel_messages, {:array, AshGraphql.Test.MessageUnion}, fn record,
%{
api: api
} ->
record = api.load!(record, :messages)

{:ok,
record.messages
|> Enum.map(&%Ash.Union{type: AshGraphql.Test.MessageUnion.struct_to_name(&1), value: &1})}
end)
calculate(
:direct_channel_messages,
{:array, AshGraphql.Test.MessageUnion},
fn record,
%{
api: api
} ->
record = api.load!(record, :messages)

{:ok,
record.messages
|> Enum.map(
&%Ash.Union{type: AshGraphql.Test.MessageUnion.struct_to_name(&1), value: &1}
)}
end
)

calculate :indirect_channel_messages,
AshGraphql.Test.PageOfChannelMessages,
Expand Down

0 comments on commit 21aed2d

Please sign in to comment.