Skip to content

Commit 8c3cc15

Browse files
committed
Fix phase result typespec
1 parent 372ee2f commit 8c3cc15

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/absinthe/phase.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ defmodule Absinthe.Phase do
99
"""
1010

1111
@type t :: module
12+
@type config_t :: t | {t, list}
1213
@type result_t ::
1314
{:ok, any}
1415
| {:jump, any, t}
15-
| {:insert, any, t | [t]}
16-
| {:replace, any, t | [t]}
16+
| {:insert, any, config_t | [config_t]}
17+
| {:replace, any, config_t | [config_t]}
1718
| {:error, any}
1819
| {:record_phases, any, (any, any -> any)}
1920

lib/absinthe/phase/subscription/subscribe_self.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ defmodule Absinthe.Phase.Subscription.SubscribeSelf do
66

77
alias Absinthe.Blueprint
88

9-
@spec run(any, Keyword.t()) ::
10-
{:ok, Blueprint.t()} | {:replace, Blueprint.t(), Absinthe.Pipeline.t()} | {:error, any}
9+
@spec run(any, Keyword.t()) :: Phase.result_t()
1110
def run(blueprint, options) do
1211
with %{type: :subscription} = op <- Blueprint.current_operation(blueprint) do
1312
do_subscription(op, blueprint, options)

lib/absinthe/pipeline.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule Absinthe.Pipeline do
1616

1717
@type data_t :: any
1818

19-
@type phase_config_t :: Phase.t() | {Phase.t(), Keyword.t()}
19+
@type phase_config_t :: Phase.config_t()
2020

2121
@type t :: [phase_config_t | [phase_config_t]]
2222

0 commit comments

Comments
 (0)