Module: GraphQL::Schema::Member::CachedGraphQLDefinition Private
- Included in:
 - Argument, EnumValue, Field, Interface::DefinitionMethods, GraphQL::Schema::Member, Wrapper
 
- Defined in:
 - lib/graphql/schema/member/cached_graphql_definition.rb
 
Overview
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.
Adds a layer of caching over user-supplied .to_graphql methods.
Users override .to_graphql, but all runtime code should use .graphql_definition.
Instance Method Summary collapse
- 
  
    
      #graphql_definition  ⇒ Object 
    
    
  
  
  
  
  
  
  
  private
  
    
A cached result of to_graphql.
 - 
  
    
      #initialize_copy(original)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  private
  
    
Wipe out the cached graphql_definition so that
.to_graphqlwill be called again. - 
  
    
      #type_class  ⇒ Object 
    
    
  
  
  
  
  
  
  
  private
  
    
This is for a common interface with .define-based types.
 
Instance Method Details
#graphql_definition ⇒ 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.
A cached result of to_graphql. It’s cached here so that user-overridden to_graphql implementations are also cached
      14 15 16  | 
    
      # File 'lib/graphql/schema/member/cached_graphql_definition.rb', line 14 def graphql_definition @graphql_definition ||= to_graphql end  | 
  
#initialize_copy(original) ⇒ 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.
Wipe out the cached graphql_definition so that .to_graphql will be called again.
      24 25 26 27  | 
    
      # File 'lib/graphql/schema/member/cached_graphql_definition.rb', line 24 def initialize_copy(original) super @graphql_definition = nil end  | 
  
#type_class ⇒ 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.
This is for a common interface with .define-based types
      19 20 21  | 
    
      # File 'lib/graphql/schema/member/cached_graphql_definition.rb', line 19 def type_class self end  |