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

Fix introspection query failing with "Cannot return null for non-nullable field" #81

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dhrdlicka
Copy link

@dhrdlicka dhrdlicka commented Nov 2, 2023

The introspection query is currently failing due to argument types for the @link directive not resolving properly, as they don't seem to get actually imported from Absinthe.Federation.Schema.Prototype.

This PR adds a import_type statement to fix that.

@kdawgwilk kdawgwilk added the bug Something isn't working label Nov 2, 2023
@kdawgwilk
Copy link
Collaborator

LGTM! @kzlsakal you want to take a look and merge if it looks good to you?

Copy link
Collaborator

@kzlsakal kzlsakal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @dhrdlicka!

I tested this on a local subgraph, and introspection on both the GraphiQL Playground and the Apollo Explorer are producing the following error, although the network call returns a successful response:

instrument.js:105 Error: Invalid or incomplete schema, unknown type: _FieldSet. Ensure that a full introspection query is used in order to build a client schema.

Do we need to omit certain records that refer to this _FieldSet? Not sure if this change is causing redundant types to be added to the schema or if they were already there, but it seems like we still cannot produce a successful introspection the way it is.

@dhrdlicka
Copy link
Author

@kzlsakal I guess I should have checked the actual query result before coming to premature conclusions 😄

Yeah, the introspection query doesn't crash anymore but the types defined in the schema prototype are still not there. I think they might be getting stripped when they're not actually used in the schema itself.

@dhrdlicka dhrdlicka marked this pull request as draft November 3, 2023 14:45
@dhrdlicka
Copy link
Author

dhrdlicka commented Nov 8, 2023

I opened an issue in the Absinthe repository for this problem: absinthe-graphql/absinthe#1279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants