Module: Dry::GraphQL
- Defined in:
- lib/dry/graphql.rb,
lib/dry/graphql/rom.rb,
lib/dry/graphql/types.rb,
lib/dry/graphql/version.rb,
lib/dry/graphql/base_object.rb,
lib/dry/graphql/type_mappings.rb,
lib/dry/graphql/schema_builder.rb
Overview
Module containing GraphQL enhancements
Defined Under Namespace
Modules: GeneratedTypes, ROM, Struct, Types Classes: BaseObject, SchemaBuilder, TypeMappings
Constant Summary collapse
- VERSION =
'2.2.0'
Class Method Summary collapse
- .from(type, name:, schema:, **opts) ⇒ Object
-
.generate_graphql_name(name) ⇒ Object
Generates a graphql_name from a class name.
- .register_type_mapping(input_type, output_type) ⇒ Object
Class Method Details
.from(type, name:, schema:, **opts) ⇒ Object
33 34 35 |
# File 'lib/dry/graphql.rb', line 33 def from(type, name:, schema:, **opts) SchemaBuilder.new(name: name, type: type, schema: schema, options: opts).graphql_type end |
.generate_graphql_name(name) ⇒ Object
Generates a graphql_name from a class name
11 12 13 |
# File 'lib/dry/graphql.rb', line 11 def self.generate_graphql_name(name) name.to_s.capitalize.gsub('DryGraphQLGeneratedTypeForUser', '').gsub('::', '__') end |
.register_type_mapping(input_type, output_type) ⇒ Object
37 38 39 |
# File 'lib/dry/graphql.rb', line 37 def register_type_mapping(input_type, output_type) TypeMappings.registry.merge!(input_type => output_type) end |