fix: render default values in SDL output for schema.sdl task#1402
Open
jruhland wants to merge 2 commits intoabsinthe-graphql:mainfrom
Open
fix: render default values in SDL output for schema.sdl task#1402jruhland wants to merge 2 commits intoabsinthe-graphql:mainfrom
jruhland wants to merge 2 commits intoabsinthe-graphql:mainfrom
Conversation
binaryseed
reviewed
Dec 23, 2025
Previously, the `mix absinthe.schema.sdl` task would not include default values for arguments and input object fields in the generated SDL output, even though the schema.json task included them in its output. Changes: - Modified SDL renderer to handle default values for InputValueDefinition (arguments) and FieldDefinition (input object fields) - Added support for DSL-defined schemas where default_value is an Elixir term that needs conversion to Blueprint.Input structures - Added support for SDL-parsed schemas where default_value_blueprint is already a Blueprint structure - Skip non-serializable values (refs, functions) Tests: - Added DefaultValueTestSchema with default value coverage to prevent regression while rendering boolean, string, and input object default values - All existing tests updated to expect default values in output
4d22224 to
8a5ef7d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #1222
Previously, the
mix absinthe.schema.sdltask would not include default values for arguments and input object fields in the generated SDL output, even though themix absinthe.schema.jsontask would properly include them in its output.Changes:
Tests:
Note:
Hit #1083 quite a bit, will see if I can address in a separate PR.