Class: GraphqlRails::Model::FindOrBuildGraphqlType
- Inherits:
-
Object
- Object
- GraphqlRails::Model::FindOrBuildGraphqlType
- Includes:
- Service
- Defined in:
- lib/graphql_rails/model/find_or_build_graphql_type.rb
Overview
stores information about model specific config, like attributes and types
Direct Known Subclasses
Instance Method Summary collapse
-
#call ⇒ Object
rubocop:enable Metrics/ParameterLists.
-
#initialize(name:, description:, attributes:, type_name:, force_define_attributes: false, implements: []) ⇒ FindOrBuildGraphqlType
constructor
rubocop:disable Metrics/ParameterLists.
Constructor Details
#initialize(name:, description:, attributes:, type_name:, force_define_attributes: false, implements: []) ⇒ FindOrBuildGraphqlType
rubocop:disable Metrics/ParameterLists
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/graphql_rails/model/find_or_build_graphql_type.rb', line 14 def initialize( name:, description:, attributes:, type_name:, force_define_attributes: false, implements: [] ) @name = name @description = description @attributes = attributes @type_name = type_name @force_define_attributes = force_define_attributes @implements = implements end |
Instance Method Details
#call ⇒ Object
rubocop:enable Metrics/ParameterLists
31 32 33 34 35 36 |
# File 'lib/graphql_rails/model/find_or_build_graphql_type.rb', line 31 def call klass.tap do add_attributes if new_class? || force_define_attributes add_interfaces end end |