-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1189 from maartenvanvliet/expose-type-system-dire…
…ctives-introspection Expose type system directives in introspection
- Loading branch information
Showing
10 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
defmodule Absinthe.Phase.Schema.ImportPrototypeDirectives do | ||
@moduledoc false | ||
|
||
# Imports directives from the prototype schema into the current schema. | ||
# This ensures the type system directives such as `deprecated` are available | ||
# for introspection as per the spec. | ||
# | ||
# Note that this does import the (type system) directives themselves, this | ||
# is already done in an earlier phase. | ||
|
||
@behaviour Absinthe.Phase | ||
alias Absinthe.Blueprint | ||
|
||
@spec run(Blueprint.t(), Keyword.t()) :: {:ok, Blueprint.t()} | ||
def run(blueprint, _options \\ []) do | ||
prototype_directives = Absinthe.Schema.directives(blueprint.prototype_schema) | ||
|
||
%{schema_definitions: [schema]} = blueprint | ||
|
||
schema = %{schema | directive_artifacts: prototype_directives} | ||
|
||
blueprint = %{blueprint | schema_definitions: [schema]} | ||
|
||
{:ok, blueprint} | ||
end | ||
end |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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