Skip to content

Commit

Permalink
Type System Directives SDL rendering (#1010)
Browse files Browse the repository at this point in the history
* Render SDL type system directives Working for `type`

* Working for all but schema

* All directives via directives

* arrange helpers

* Further cleanup

* Directives on schema declaration

* rm notes

* test names
  • Loading branch information
binaryseed authored Dec 28, 2020
1 parent bd0efe3 commit 8d41b34
Show file tree
Hide file tree
Showing 7 changed files with 305 additions and 140 deletions.
1 change: 1 addition & 0 deletions lib/absinthe/blueprint/schema/schema_definition.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ defmodule Absinthe.Blueprint.Schema.SchemaDefinition do
directives: [],
source_location: nil,
# Added by phases
schema_declaration: nil,
flags: %{},
imports: [],
errors: [],
Expand Down
3 changes: 2 additions & 1 deletion lib/absinthe/phase/schema/apply_declaration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ defmodule Absinthe.Phase.Schema.ApplyDeclaration do
%{
schema_definition
| type_definitions:
Enum.map(schema_definition.type_definitions, &maybe_mark_root(&1, root_mappings))
Enum.map(schema_definition.type_definitions, &maybe_mark_root(&1, root_mappings)),
schema_declaration: declaration
}

[] ->
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ defmodule Absinthe.Schema do
def to_sdl(schema) do
pipeline =
schema
|> Absinthe.Pipeline.for_schema()
|> Absinthe.Pipeline.for_schema(prototype_schema: schema.__absinthe_prototype_schema__)
|> Absinthe.Pipeline.upto({Absinthe.Phase.Schema.Validation.Result, pass: :final})
|> apply_modifiers(schema)

Expand Down
Loading

0 comments on commit 8d41b34

Please sign in to comment.