Module: GraphQL::Schema::Member::CachedGraphQLDefinition::DeprecatedToGraphQL Private

Included in:
GraphQL::Schema, Argument, Directive, Enum, EnumValue, Field, InputObject, Interface::DefinitionMethods, List, NonNull, Object, Scalar, Union
Defined in:
lib/graphql/schema/member/cached_graphql_definition.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#to_graphql(silence_deprecation_warning: false) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



46
47
48
49
50
51
52
53
# File 'lib/graphql/schema/member/cached_graphql_definition.rb', line 46

def to_graphql(silence_deprecation_warning: false)
  unless silence_deprecation_warning
    message = "Legacy `.to_graphql` objects are deprecated and will be removed in GraphQL-Ruby 2.0. Remove `.to_graphql` to use a class-based definition instead."
    caller_message = "\n\nCalled on #{self.inspect} from:\n #{caller(1, 25).map { |l| "  #{l}" }.join("\n")}"
    GraphQL::Deprecation.warn(message + caller_message)
  end
  super()
end