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

Module attribute name mismatch for :__absinthe_type_import__ vs :__absinthe_type_import__? #1119

Open
elbow-jason opened this issue Nov 15, 2021 · 0 comments

Comments

@elbow-jason
Copy link

During Absinthe.Schema.Notation.__using__/1 the module attribute :__absinthe_type_import__ is defined with accumulate: true, but later in the Notation module a very similar, but different module attribute :__absinthe_type_imports__ is used 3 times.

The module attribute registration:

Module.register_attribute(__MODULE__, :__absinthe_type_import__, accumulate: true)

The first and second uses:

defp do_import_types(module, env, opts) do
Module.put_attribute(env.module, :__absinthe_type_imports__, [
{module, opts} | Module.get_attribute(env.module, :__absinthe_type_imports__) || []
])
[]
end

The third use:

imports =
(Module.get_attribute(env.module, :__absinthe_type_imports__) || [])
|> Enum.uniq()
|> Enum.map(fn
module when is_atom(module) -> {module, []}
other -> other
end)

Looks like potential the source of a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant