diff --git a/lib/absinthe/schema/notation.ex b/lib/absinthe/schema/notation.ex index cf3bae7e6f..d280308aba 100644 --- a/lib/absinthe/schema/notation.ex +++ b/lib/absinthe/schema/notation.ex @@ -354,6 +354,20 @@ defmodule Absinthe.Schema.Notation do end end + block = + case Keyword.get(attrs, :meta) do + nil -> + block + + meta -> + meta_ast = + quote do + meta unquote(meta) + end + + [meta_ast, block] + end + {func_ast, attrs} = Keyword.pop(attrs, :resolve) block = @@ -371,6 +385,7 @@ defmodule Absinthe.Schema.Notation do attrs |> expand_ast(caller) |> Keyword.delete(:args) + |> Keyword.delete(:meta) |> handle_deprecate {attrs, block} diff --git a/test/absinthe/schema/manipulation_test.exs b/test/absinthe/schema/manipulation_test.exs index 4e855c7c3d..96e5d3f5a3 100644 --- a/test/absinthe/schema/manipulation_test.exs +++ b/test/absinthe/schema/manipulation_test.exs @@ -152,8 +152,7 @@ defmodule Absinthe.Schema.ManipulationTest do meta :some_string_meta, "non_dyn_integer meta" end - field :non_dyn_string, :string do - meta :some_string_meta, "non_dyn_string meta" + field :non_dyn_string, :string, meta: [some_string_meta: "non_dyn_string meta"] do resolve fn _, _ -> {:ok, "some_string_val"} end end end