Class: GraphQL::Introspection::FieldType

Inherits:
Introspection::BaseObject
  • Object
show all
Defined in:
lib/graphql/introspection/field_type.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.resolve_args(object, context, include_deprecated:) ⇒ Object

: (GraphQL::Schema::Field object, GraphQL::Query::Context context, include_deprecated: bool) -> Array



30
31
32
33
34
# File 'lib/graphql/introspection/field_type.rb', line 30

def self.resolve_args(object, context, include_deprecated:)
  args = context.types.arguments(object)
  args = args.reject(&:deprecation_reason) unless include_deprecated
  args
end

.resolve_is_deprecated(object, _context) ⇒ Object

: (GraphQL::Schema::Field object, GraphQL::Query::Context _context) -> bool



20
21
22
# File 'lib/graphql/introspection/field_type.rb', line 20

def self.resolve_is_deprecated(object, _context)
  !!object.deprecation_reason
end

Instance Method Details

#args(include_deprecated:) ⇒ Object

: (include_deprecated: bool) -> Array



37
38
39
# File 'lib/graphql/introspection/field_type.rb', line 37

def args(include_deprecated:)
  self.class.resolve_args(object, context, include_deprecated: include_deprecated)
end

#is_deprecated ⇒ Object

: -> bool



25
26
27
# File 'lib/graphql/introspection/field_type.rb', line 25

def is_deprecated
  self.class.resolve_is_deprecated(object, context)
end