Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #937
I can reproduce issue #937 with a repo with absinthe as a dependency but not from within a test in absinthe. Has to do with the modules not being compiled (yet)
Changing https://github.com/absinthe-graphql/absinthe/blob/master/lib/absinthe/schema/notation.ex#L1683 to
if Code.ensure_compiled(type_module) do
fixed it. (See #534 for dealing with this in an earlier version).Or, removing the if-clause entirely and relying on the TypeImports phase to handle this. This is what happens for ordinary imports like
import_types(MyApp.Schema.Types.UnknownModule)
. I've done this in this PR and let failed imports add a phase error to the schema.This could also be extended that whenever non absinthe modules are imported another error is added e.g.
The TypeImports phase could check
function_exported(Test, :__absinthe_blueprint__, 0)
and add an error if it's not present.