Sha256: 02251a0e5e18ee558a9c60fa7c48fc3d731ea4c31d1d70ce70e2297256ff2dc5

Contents?: true

Size: 1.33 KB

Versions: 38

Compression:

Stored size: 1.33 KB

Contents

# frozen_string_literal: true
module GraphQL
  module Introspection
    class DirectiveType < Introspection::BaseObject
      graphql_name "__Directive"
      description "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document."\
                  "\n\n"\
                  "In some cases, you need to provide options to alter GraphQL's execution behavior "\
                  "in ways field arguments will not suffice, such as conditionally including or "\
                  "skipping a field. Directives provide this by describing additional information "\
                    "to the executor."
      field :name, String, null: false, method: :graphql_name
      field :description, String, null: true
      field :locations, [GraphQL::Schema::LateBoundType.new("__DirectiveLocation")], null: false
      field :args, [GraphQL::Schema::LateBoundType.new("__InputValue")], null: false
      field :on_operation, Boolean, null: false, deprecation_reason: "Use `locations`.", method: :on_operation?
      field :on_fragment, Boolean, null: false, deprecation_reason: "Use `locations`.", method: :on_fragment?
      field :on_field, Boolean, null: false, deprecation_reason: "Use `locations`.", method: :on_field?

      def args
        @context.warden.arguments(@object)
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
graphql-1.11.12 lib/graphql/introspection/directive_type.rb
graphql-1.11.11 lib/graphql/introspection/directive_type.rb
graphql-1.11.10 lib/graphql/introspection/directive_type.rb
graphql-1.11.9 lib/graphql/introspection/directive_type.rb
graphql-1.12.6 lib/graphql/introspection/directive_type.rb
graphql-1.12.5 lib/graphql/introspection/directive_type.rb
graphql-1.11.8 lib/graphql/introspection/directive_type.rb
graphql-1.12.4 lib/graphql/introspection/directive_type.rb
graphql-1.12.3 lib/graphql/introspection/directive_type.rb
graphql-1.12.2 lib/graphql/introspection/directive_type.rb
graphql-1.12.1 lib/graphql/introspection/directive_type.rb
graphql-1.12.0 lib/graphql/introspection/directive_type.rb
graphql-1.11.7 lib/graphql/introspection/directive_type.rb
graphql-1.11.6 lib/graphql/introspection/directive_type.rb
graphql-1.11.5 lib/graphql/introspection/directive_type.rb
graphql-1.11.4 lib/graphql/introspection/directive_type.rb
graphql-1.11.3 lib/graphql/introspection/directive_type.rb
graphql-1.11.2 lib/graphql/introspection/directive_type.rb
graphql-1.10.14 lib/graphql/introspection/directive_type.rb
graphql-1.11.1 lib/graphql/introspection/directive_type.rb