Skip to content

fix: Handle nil values in SDL render to prevent inspection errors#1400

Closed
dorian-marchal wants to merge 1 commit intoabsinthe-graphql:mainfrom
dorian-marchal:inspect-error
Closed

fix: Handle nil values in SDL render to prevent inspection errors#1400
dorian-marchal wants to merge 1 commit intoabsinthe-graphql:mainfrom
dorian-marchal:inspect-error

Conversation

@dorian-marchal
Copy link
Copy Markdown
Contributor

Inspecting a schema blueprint with pretty: true was crashing with an "Unexpected nil" error:

#Inspect.Error<
  got RuntimeError with message:

      """
      Unexpected nil
      """

  while inspecting:

      %{
        __struct__: Absinthe.Blueprint,
  ...

Changes

  • Changed the render function to just return an empty string instead of raising.
  • Added a test to make sure inspection doesn't crash anymore

Heads up

This fixes the crash, but I'm not totally sure this is the right approach. It's likely that nil values shouldn't be showing up here in the first place, and this may just cover a deeper issue.

Fixes #1185

@dorian-marchal dorian-marchal changed the title Fix: Handle nil values in SDL render to prevent inspection errors fix: Handle nil values in SDL render to prevent inspection errors Jan 7, 2026
@dorian-marchal
Copy link
Copy Markdown
Contributor Author

This fix is probably invalid, opened an issue with more information instead: #1403

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

blueprint inside telemetry events comes out as Inspect.Error when in IEx

1 participant