diff --git a/lib/absinthe/blueprint/directive.ex b/lib/absinthe/blueprint/directive.ex index 21322fd978..5f4198fbb4 100644 --- a/lib/absinthe/blueprint/directive.ex +++ b/lib/absinthe/blueprint/directive.ex @@ -55,7 +55,6 @@ defmodule Absinthe.Blueprint.Directive do def placement(%Blueprint.Document.Fragment.Named{}), do: :fragment_definition def placement(%Blueprint.Document.Fragment.Spread{}), do: :fragment_spread def placement(%Blueprint.Document.Fragment.Inline{}), do: :inline_fragment - def placement(%Blueprint.Document.Operation{}), do: :operation_definition def placement(%Blueprint.Schema.SchemaDefinition{}), do: :schema def placement(%Blueprint.Schema.SchemaDeclaration{}), do: :schema def placement(%Blueprint.Schema.ScalarTypeDefinition{}), do: :scalar diff --git a/lib/absinthe/type/built_ins/introspection.ex b/lib/absinthe/type/built_ins/introspection.ex index 47208fc403..225b9c7eb8 100644 --- a/lib/absinthe/type/built_ins/introspection.ex +++ b/lib/absinthe/type/built_ins/introspection.ex @@ -77,15 +77,24 @@ defmodule Absinthe.Type.BuiltIns.Introspection do enum :__directive_location, values: [ - # OPERATIONS :query, :mutation, :subscription, :field, :fragment_definition, :fragment_spread, - :inline_fragment - # TODO: Schema definitions to support Schema input + :inline_fragment, + :schema, + :scalar, + :object, + :field_definition, + :interface, + :union, + :enum, + :enum_value, + :input_object, + :argument_definition, + :input_field_definition ] object :__type do diff --git a/lib/absinthe/type/directive.ex b/lib/absinthe/type/directive.ex index 191ef04765..bfb9643a29 100644 --- a/lib/absinthe/type/directive.ex +++ b/lib/absinthe/type/directive.ex @@ -61,6 +61,17 @@ defmodule Absinthe.Type.Directive do defp do_on?(:fragment_definition, %Language.Fragment{}), do: true defp do_on?(:fragment_spread, %Language.FragmentSpread{}), do: true defp do_on?(:inline_fragment, %Language.InlineFragment{}), do: true - # TODO: Schema definitions to support Schema input + defp do_on?(:schema, %Language.SchemaDefinition{}), do: true + defp do_on?(:schema, %Language.SchemaDeclaration{}), do: true + defp do_on?(:scalar, %Language.ScalarTypeDefinition{}), do: true + defp do_on?(:object, %Language.ObjectTypeDefinition{}), do: true + defp do_on?(:field_definition, %Language.FieldDefinition{}), do: true + defp do_on?(:interface, %Language.InterfaceTypeDefinition{}), do: true + defp do_on?(:union, %Language.UnionTypeDefinition{}), do: true + defp do_on?(:enum, %Language.EnumTypeDefinition{}), do: true + defp do_on?(:enum_value, %Language.EnumValueDefinition{}), do: true + defp do_on?(:input_object, %Language.InputObjectTypeDefinition{}), do: true + defp do_on?(:argument_definition, %Language.InputValueDefinition{}), do: true + defp do_on?(:input_field_definition, %Language.InputValueDefinition{}), do: true defp do_on?(_, _), do: false end