diff --git a/lib/absinthe/blueprint/schema.ex b/lib/absinthe/blueprint/schema.ex index 4657c299..f2a44f29 100644 --- a/lib/absinthe/blueprint/schema.ex +++ b/lib/absinthe/blueprint/schema.ex @@ -59,7 +59,7 @@ defmodule Absinthe.Blueprint.Schema do def functions(module) do if function_exported?(module, :functions, 0) do - module.functions + module.functions() else [] end diff --git a/lib/absinthe/phase/document/validation/fields_on_correct_type.ex b/lib/absinthe/phase/document/validation/fields_on_correct_type.ex index 9d36d591..58911b58 100644 --- a/lib/absinthe/phase/document/validation/fields_on_correct_type.ex +++ b/lib/absinthe/phase/document/validation/fields_on_correct_type.ex @@ -121,7 +121,7 @@ defmodule Absinthe.Phase.Document.Validation.FieldsOnCorrectType do [identifier] %Type.Interface{identifier: identifier} -> - schema.__absinthe_interface_implementors__ + schema.__absinthe_interface_implementors__() |> Map.fetch!(identifier) %Type.Union{types: types} -> diff --git a/lib/absinthe/phase/schema/directive_imports.ex b/lib/absinthe/phase/schema/directive_imports.ex index 848bc57c..ae989593 100644 --- a/lib/absinthe/phase/schema/directive_imports.ex +++ b/lib/absinthe/phase/schema/directive_imports.ex @@ -33,7 +33,7 @@ defmodule Absinthe.Phase.Schema.DirectiveImports do defp do_imports([{module, opts} | rest], acc, schema) do case ensure_compiled(module) do {:module, module} -> - [other_def] = module.__absinthe_blueprint__.schema_definitions + [other_def] = module.__absinthe_blueprint__().schema_definitions rejections = MapSet.new(Keyword.get(opts, :except, [])) diff --git a/lib/absinthe/phase/schema/spec_compliant_int.ex b/lib/absinthe/phase/schema/spec_compliant_int.ex index 818bd0f6..f29f744d 100644 --- a/lib/absinthe/phase/schema/spec_compliant_int.ex +++ b/lib/absinthe/phase/schema/spec_compliant_int.ex @@ -21,7 +21,7 @@ defmodule Absinthe.Phase.Schema.SpecCompliantInt do defp handle_node(%Blueprint.Schema.ScalarTypeDefinition{identifier: :integer}) do case ensure_compiled(Absinthe.Type.BuiltIns.SpecCompliantInt) do {:module, module} -> - [types] = module.__absinthe_blueprint__.schema_definitions + [types] = module.__absinthe_blueprint__().schema_definitions Enum.find( types.type_definitions, diff --git a/lib/absinthe/phase/schema/type_extension_imports.ex b/lib/absinthe/phase/schema/type_extension_imports.ex index b09fb2dc..4728b63d 100644 --- a/lib/absinthe/phase/schema/type_extension_imports.ex +++ b/lib/absinthe/phase/schema/type_extension_imports.ex @@ -35,7 +35,7 @@ defmodule Absinthe.Phase.Schema.TypeExtensionImports do defp do_imports([{module, opts} | rest], type_extensions_acc, schema) do case ensure_compiled(module) do {:module, module} -> - [other_def] = module.__absinthe_blueprint__.schema_definitions + [other_def] = module.__absinthe_blueprint__().schema_definitions rejections = Keyword.get(opts, :except, []) |> MapSet.new() diff --git a/lib/absinthe/phase/schema/type_imports.ex b/lib/absinthe/phase/schema/type_imports.ex index 78b0c78a..6dac0457 100644 --- a/lib/absinthe/phase/schema/type_imports.ex +++ b/lib/absinthe/phase/schema/type_imports.ex @@ -35,7 +35,7 @@ defmodule Absinthe.Phase.Schema.TypeImports do defp do_imports([{module, opts} | rest], types_acc, schema) do case ensure_compiled(module) do {:module, module} -> - [other_def] = module.__absinthe_blueprint__.schema_definitions + [other_def] = module.__absinthe_blueprint__().schema_definitions rejections = MapSet.new([:query, :mutation, :subscription] ++ Keyword.get(opts, :except, [])) diff --git a/lib/absinthe/schema.ex b/lib/absinthe/schema.ex index 1d1a9f72..a1bd36fa 100644 --- a/lib/absinthe/schema.ex +++ b/lib/absinthe/schema.ex @@ -27,7 +27,7 @@ defmodule Absinthe.Schema do ``` You can see what your schema's blueprint looks like by calling - `__absinthe_blueprint__` on any schema or type definition module. + `__absinthe_blueprint__()` on any schema or type definition module. ``` defmodule MyAppWeb.Schema do @@ -38,7 +38,7 @@ defmodule Absinthe.Schema do end end - > MyAppWeb.Schema.__absinthe_blueprint__ + > MyAppWeb.Schema.__absinthe_blueprint__() #=> %Absinthe.Blueprint{...} ``` @@ -88,7 +88,7 @@ defmodule Absinthe.Schema do end end - Foo.__absinthe_blueprint__ #=> ... + Foo.__absinthe_blueprint__() #=> ... ``` """ @@ -363,7 +363,7 @@ defmodule Absinthe.Schema do @spec apply_modifiers(Absinthe.Pipeline.t(), t) :: Absinthe.Pipeline.t() def apply_modifiers(pipeline, schema) do - Enum.reduce(schema.__absinthe_pipeline_modifiers__, pipeline, fn + Enum.reduce(schema.__absinthe_pipeline_modifiers__(), pipeline, fn {module, function}, pipeline -> apply(module, function, [pipeline]) @@ -382,7 +382,7 @@ defmodule Absinthe.Schema do |> Absinthe.Pipeline.for_schema(prototype_schema: prototype_schema) |> apply_modifiers(env.module) - env.module.__absinthe_blueprint__ + env.module.__absinthe_blueprint__() |> Absinthe.Pipeline.run(pipeline) |> case do {:ok, _, _} -> @@ -621,7 +621,7 @@ defmodule Absinthe.Schema do """ @spec directives(t) :: [Type.Directive.t()] def directives(schema) do - schema.__absinthe_directives__ + schema.__absinthe_directives__() |> Map.keys() |> Enum.map(&lookup_directive(schema, &1)) end @@ -643,7 +643,7 @@ defmodule Absinthe.Schema do def to_sdl(schema) do pipeline = schema - |> Absinthe.Pipeline.for_schema(prototype_schema: schema.__absinthe_prototype_schema__) + |> Absinthe.Pipeline.for_schema(prototype_schema: schema.__absinthe_prototype_schema__()) |> Absinthe.Pipeline.upto({Absinthe.Phase.Schema.Validation.Result, pass: :final}) |> apply_modifiers(schema) @@ -659,7 +659,7 @@ defmodule Absinthe.Schema do """ @spec implementors(t, Type.identifier_t() | Type.Interface.t()) :: [Type.Object.t()] def implementors(schema, ident) when is_atom(ident) do - schema.__absinthe_interface_implementors__ + schema.__absinthe_interface_implementors__() |> Map.get(ident, []) |> Enum.map(&lookup_type(schema, &1)) end @@ -673,7 +673,7 @@ defmodule Absinthe.Schema do """ @spec types(t) :: [Type.t()] def types(schema) do - schema.__absinthe_types__ + schema.__absinthe_types__() |> Map.keys() |> Enum.map(&lookup_type(schema, &1)) end diff --git a/lib/absinthe/schema/compiled.ex b/lib/absinthe/schema/compiled.ex index c800dd8b..ee3b70bf 100644 --- a/lib/absinthe/schema/compiled.ex +++ b/lib/absinthe/schema/compiled.ex @@ -16,7 +16,7 @@ defmodule Absinthe.Schema.Compiled do end def __absinthe_types__(schema_mod) do - Module.concat([schema_mod, Compiled]).__absinthe_types__ + Module.concat([schema_mod, Compiled]).__absinthe_types__() end def __absinthe_types__(schema_mod, group) do @@ -24,14 +24,14 @@ defmodule Absinthe.Schema.Compiled do end def __absinthe_directives__(schema_mod) do - Module.concat([schema_mod, Compiled]).__absinthe_directives__ + Module.concat([schema_mod, Compiled]).__absinthe_directives__() end def __absinthe_interface_implementors__(schema_mod) do - Module.concat([schema_mod, Compiled]).__absinthe_interface_implementors__ + Module.concat([schema_mod, Compiled]).__absinthe_interface_implementors__() end def __absinthe_schema_declaration__(schema_mod) do - Module.concat([schema_mod, Compiled]).__absinthe_schema_declaration__ + Module.concat([schema_mod, Compiled]).__absinthe_schema_declaration__() end end diff --git a/lib/absinthe/schema/manager.ex b/lib/absinthe/schema/manager.ex index b9a17e21..a0ab8c7c 100644 --- a/lib/absinthe/schema/manager.ex +++ b/lib/absinthe/schema/manager.ex @@ -6,14 +6,14 @@ defmodule Absinthe.Schema.Manager do end def init(schema_module) do - prototype_schema = schema_module.__absinthe_prototype_schema__ + prototype_schema = schema_module.__absinthe_prototype_schema__() pipeline = schema_module |> Absinthe.Pipeline.for_schema(prototype_schema: prototype_schema) |> Absinthe.Schema.apply_modifiers(schema_module) - schema_module.__absinthe_blueprint__ + schema_module.__absinthe_blueprint__() |> Absinthe.Pipeline.run(pipeline) |> case do {:ok, _, _} -> diff --git a/lib/absinthe/type/built_ins/introspection.ex b/lib/absinthe/type/built_ins/introspection.ex index 15ec76fe..9d74749c 100644 --- a/lib/absinthe/type/built_ins/introspection.ex +++ b/lib/absinthe/type/built_ins/introspection.ex @@ -93,7 +93,7 @@ defmodule Absinthe.Type.BuiltIns.Introspection do field :kind, type: non_null(:__type_kind), resolve: fn _, %{source: %{__struct__: type}} -> - {:ok, type.kind} + {:ok, type.kind()} end field :name, :string diff --git a/lib/absinthe/utils.ex b/lib/absinthe/utils.ex index 648ca868..eaa56256 100644 --- a/lib/absinthe/utils.ex +++ b/lib/absinthe/utils.ex @@ -116,7 +116,7 @@ defmodule Absinthe.Utils do |> List.last() types = - module.__absinthe_types__ + module.__absinthe_types__() |> Map.keys() |> Enum.sort_by(& &1) |> Enum.map(fn identifier -> @@ -131,7 +131,7 @@ defmodule Absinthe.Utils do end) directives = - module.__absinthe_directives__ + module.__absinthe_directives__() |> Map.keys() |> Enum.sort_by(& &1) |> Enum.map(fn identifier ->