Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[in-review] Some code-optimisations necessary for the project #1281

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/absinthe/blueprint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ defmodule Absinthe.Blueprint do
@doc """
Append the given field or fields to the given type
"""
def extend_fields(blueprint = %Blueprint{}, ext_blueprint = %Blueprint{}) do
def extend_fields(%Blueprint{} = blueprint, %Blueprint{} = ext_blueprint) do
ext_types = types_by_name(ext_blueprint)

schema_defs =
Expand All @@ -178,7 +178,7 @@ defmodule Absinthe.Blueprint do
extend_fields(blueprint, ext_blueprint.__absinthe_blueprint__())
end

def add_field(blueprint = %Blueprint{}, type_def_name, new_field) do
def add_field(%Blueprint{} = blueprint, type_def_name, new_field) do
schema_defs =
for schema_def = %{type_definitions: type_defs} <- blueprint.schema_definitions do
type_defs =
Expand All @@ -203,7 +203,7 @@ defmodule Absinthe.Blueprint do
@doc """
Index the types by their name
"""
def types_by_name(blueprint = %Blueprint{}) do
def types_by_name(%Blueprint{} = blueprint) do
for %{type_definitions: type_defs} <- blueprint.schema_definitions,
type_def <- type_defs,
into: %{} do
Expand Down
4 changes: 2 additions & 2 deletions lib/absinthe/middleware/async.ex
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ defmodule Absinthe.Middleware.Async do

# Optionally use `async/1` function from `opentelemetry_process_propagator` if available
if Code.ensure_loaded?(OpentelemetryProcessPropagator.Task) do
@spec async((-> any)) :: Task.t()
@spec async((() -> any)) :: Task.t()
defdelegate async(fun), to: OpentelemetryProcessPropagator.Task
else
@spec async((-> any)) :: Task.t()
@spec async((() -> any)) :: Task.t()
defdelegate async(fun), to: Task
end
end
4 changes: 2 additions & 2 deletions lib/absinthe/middleware/batch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ defmodule Absinthe.Middleware.Batch do

# Optionally use `async/1` function from `opentelemetry_process_propagator` if available
if Code.ensure_loaded?(OpentelemetryProcessPropagator.Task) do
@spec async((-> any)) :: Task.t()
@spec async((() -> any)) :: Task.t()
defdelegate async(fun), to: OpentelemetryProcessPropagator.Task
else
@spec async((-> any)) :: Task.t()
@spec async((() -> any)) :: Task.t()
defdelegate async(fun), to: Task
end
end
3 changes: 2 additions & 1 deletion lib/absinthe/phase/debug.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ defmodule Absinthe.Phase.Debug do

@moduledoc false

require Logger
alias Absinthe.Blueprint

@spec run(any, Keyword.t()) :: {:ok, Blueprint.t()}
def run(input, _options \\ []) do
if System.get_env("DEBUG") do
IO.inspect(input, label: :debug_blueprint_output)
Logger.info(input)
end

{:ok, input}
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/phase/document/execution/resolution.ex
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ defmodule Absinthe.Phase.Document.Execution.Resolution do
walk_results(values, bp_node, inner_type, res, [i + 1 | sub_path], [result | acc])
end

defp walk_results([], _, _, res = %{path: [_ | sub_path]}, _, acc),
defp walk_results([], _, _, %{path: [_ | sub_path]} = res, _, acc),
do: {:lists.reverse(acc), %{res | path: sub_path}}

defp walk_results([], _, _, res, _, acc), do: {:lists.reverse(acc), res}
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/phase/schema/apply_declaration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule Absinthe.Phase.Schema.ApplyDeclaration do

# Apply schema declaration to each schema definition
@spec process(blueprint :: Blueprint.t()) :: Blueprint.t()
defp process(blueprint = %Blueprint{}) do
defp process(%Blueprint{} = blueprint) do
%{
blueprint
| schema_definitions: Enum.map(blueprint.schema_definitions, &process_schema_definition/1)
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/phase/schema/apply_type_extensions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule Absinthe.Phase.Schema.ApplyTypeExtensions do
{:ok, blueprint}
end

defp process(blueprint = %Blueprint{}) do
defp process(%Blueprint{} = blueprint) do
%{blueprint | schema_definitions: update_schema_defs(blueprint.schema_definitions)}
end

Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/phase/schema/introspection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule Absinthe.Phase.Schema.Introspection do
@doc """
Append the given field or fields to the given type
"""
def attach_introspection_fields(blueprint = %Blueprint{}) do
def attach_introspection_fields(%Blueprint{} = blueprint) do
%{blueprint | schema_definitions: update_schema_defs(blueprint.schema_definitions)}
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule Absinthe.Phase.Schema.Validation.InterfacesMustResolveTypes do
defp validate_interface(%Blueprint.Schema.InterfaceTypeDefinition{} = iface, implementors) do
resolve_type = Absinthe.Type.function(iface, :resolve_type)

if(resolve_type || all_objects_is_type_of?(iface, implementors)) do
if resolve_type || all_objects_is_type_of?(iface, implementors) do
iface
else
iface |> put_error(error(iface))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ defmodule Absinthe.Phase.Schema.Validation.TypeNamesAreReserved do
{:ok, bp}
end

def allow_reserved(node = %{flags: nil}) do
def allow_reserved(%{flags: nil} = node) do
allow_reserved(%{node | flags: %{}})
end

def allow_reserved(node = %{flags: flags}) do
def allow_reserved(%{flags: flags} = node) do
flags =
flags
|> Map.put(:reserved_name, true)

%{node | flags: flags}
end

def make_reserved(node = %{name: "__" <> _}) do
def make_reserved(%{name: "__" <> _} = node) do
allow_reserved(node)
end

def make_reserved(node = %{name: name, identifier: identifier}) do
def make_reserved(%{name: name, identifier: identifier} = node) do
node = %{
node
| name: name |> String.replace_prefix("", "__"),
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/pipeline/batch_resolver.ex
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ defmodule Absinthe.Pipeline.BatchResolver do
end
end

defp run_pipeline(bp, phases, _abort_on_error? = true) do
defp run_pipeline(bp, phases, true) do
{:ok, blueprint, _} = Absinthe.Pipeline.run(bp, phases)
{:ok, blueprint}
end
Expand Down
4 changes: 2 additions & 2 deletions lib/absinthe/resolution/helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ defmodule Absinthe.Resolution.Helpers do
end
```
"""
@spec async((-> term)) :: {:middleware, Middleware.Async, term}
@spec async((-> term), opts :: [{:timeout, pos_integer}]) ::
@spec async((() -> term)) :: {:middleware, Middleware.Async, term}
@spec async((() -> term), opts :: [{:timeout, pos_integer}]) ::
{:middleware, Middleware.Async, term}
def async(fun, opts \\ []) do
{:middleware, Middleware.Async, {fun, opts}}
Expand Down
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ defmodule Absinthe.Mixfile do
{:benchee, ">= 1.0.0", only: :dev},
{:dialyxir, "~> 1.1.0", only: [:dev, :test], runtime: false},
{:mix_test_watch, "~> 1.0", only: :dev, runtime: false},
{:makeup_graphql, "~> 0.1.0", only: :dev}
{:makeup_graphql, "~> 0.1.0", only: :dev},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false}
]
end

Expand Down
3 changes: 3 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
%{
"benchee": {:hex, :benchee, "1.1.0", "f3a43817209a92a1fade36ef36b86e1052627fd8934a8b937ac9ab3a76c43062", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}], "hexpm", "7da57d545003165a012b587077f6ba90b89210fd88074ce3c60ce239eb5e6d93"},
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"credo": {:hex, :credo, "1.7.1", "6e26bbcc9e22eefbff7e43188e69924e78818e2fe6282487d0703652bc20fd62", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e9871c6095a4c0381c89b6aa98bc6260a8ba6addccf7f6a53da8849c748a58a2"},
"dataloader": {:hex, :dataloader, "1.0.8", "114294362db98a613f231589246aa5b0ce847412e8e75c4c94f31f204d272cbf", [:mix], [{:ecto, ">= 3.4.3 and < 4.0.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "eaf3c2aa2bc9dbd2f1e960561d616b7f593396c4754185b75904f6d66c82a667"},
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
"deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"},
Expand All @@ -8,6 +10,7 @@
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_doc": {:hex, :ex_doc, "0.29.4", "6257ecbb20c7396b1fe5accd55b7b0d23f44b6aa18017b415cb4c2b91d997729", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2c6699a737ae46cb61e4ed012af931b57b699643b24dabe2400a8168414bc4f5"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToElementOfTypeListOf_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToElementOfTypeListOfTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToElementOfTypeNonNullListOf_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToElementOfTypeNonNullListOfTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToType_TOverridesDefaultValueTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeTOverridesDefaultValueTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeListOf_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeListOfTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeNonNull_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeNonNullTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeNonNullListOf_TElementTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeNonNullListOfTElementTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeNonNullListOf_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeNonNullListOfTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeNonNullListOfNonNull_TElementTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeNonNullListOfNonNullTElementTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeNonNullListOfNonNull_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.LiteralToTypeNonNullListOfNonNullTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToType_TOverridesDefaultValueTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeTOverridesDefaultValueTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToType_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeListOf_TElementTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeListOfTElementTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeListOf_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeListOfTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeNonNull_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeNonNullTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeNonNullListOf_TElementTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeNonNullListOfTElementTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeNonNullListOf_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeNonNullListOfTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeNonNullListOfNonNull_TElementTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeNonNullListOfNonNullTElementTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeNonNullListOfNonNull_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToTypeNonNullListOfNonNullTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToVariableTypeNonNull_TTest do
defmodule Elixir.Absinthe.Integration.Execution.InputTypes.Null.VariableToVariableTypeNonNullTTest do
use Absinthe.Case, async: true

@query """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ defmodule Elixir.Absinthe.Integration.Execution.OperationByNameTest do

test "scenario #4" do
assert {:ok, %{data: %{"thing" => %{"name" => "Bar"}}}} ==
Absinthe.run(@query, Absinthe.Fixtures.Things.MacroSchema,
operation_name: "ThingBar"
)
Absinthe.run(@query, Absinthe.Fixtures.Things.MacroSchema, operation_name: "ThingBar")
end

@query """
Expand Down
2 changes: 1 addition & 1 deletion test/absinthe/lexer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ defmodule Absinthe.LexerTest do
end

defp too_long_query do
Enum.to_list(for n <- 1..10000, do: "test#{n}")
Enum.to_list(for n <- 1..10_000, do: "test#{n}")
|> deep_query()
end

Expand Down
8 changes: 4 additions & 4 deletions test/absinthe/pipeline_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ defmodule Absinthe.PipelineTest do
end
end

@goodQuery """
@good_query """
{ foo { bar } }
"""

@badQuery """
@bad_query """
{ noFoo { bar } }
"""
test "well-formed query" do
{:ok, %{execution: %{validation_errors: validation_errors}}, _} =
validation_only_query(@goodQuery)
validation_only_query(@good_query)

assert length(validation_errors) == 0
end

test "ill-formed query" do
{:ok, %{execution: %{validation_errors: validation_errors}}, _} =
validation_only_query(@badQuery)
validation_only_query(@bad_query)

refute length(validation_errors) == 0
end
Expand Down
4 changes: 2 additions & 2 deletions test/absinthe/schema/manipulation_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ defmodule Absinthe.Schema.ManipulationTest do
end

# Here's the blueprint of the schema, let's do whatever we want with it.
def run(blueprint = %Blueprint{}, _) do
def run(%Blueprint{} = blueprint, _) do
custom_introspection_types = Blueprint.types_by_name(CustomIntrospectionTypes)
custom_introspection_fields = custom_introspection_types["CustomIntrospectionHelper"]

Expand Down Expand Up @@ -90,7 +90,7 @@ defmodule Absinthe.Schema.ManipulationTest do
Pipeline.insert_after(pipeline, Phase.Schema.TypeImports, __MODULE__)
end

def run(blueprint = %Blueprint{}, _) do
def run(%Blueprint{} = blueprint, _) do
%{schema_definitions: [schema]} = blueprint

new_enum = build_dynamic_enum()
Expand Down
3 changes: 1 addition & 2 deletions test/absinthe/subscription/pipeline_serializer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ defmodule Absinthe.Subscription.PipelineSerializerTest do
0 => %{large: 123},
1 => [context: [:pack | 0]],
2 => [context: [:pack | 0], another: 456]
}} =
PipelineSerializer.pack(pipeline)
}} = PipelineSerializer.pack(pipeline)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/mix/tasks/absinthe.schema.sdl_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ defmodule Mix.Tasks.Absinthe.Schema.SdlTest do
end

# Here's the blueprint of the schema, let's do whatever we want with it.
def run(blueprint = %Blueprint{}, _) do
def run(%Blueprint{} = blueprint, _) do
test_mod_types = Blueprint.types_by_name(TestModField)
test_mod_fields = test_mod_types["TestModHelper"]

Expand Down
Loading