module Dry::GraphQL

Module containing GraphQL enhancements

Constants

VERSION

Public Class Methods

from(type, name:, schema:, **opts) click to toggle source
# File lib/dry/graphql.rb, line 35
def from(type, name:, schema:, **opts)
  SchemaBuilder.new(name: name, type: type, schema: schema, options: opts).graphql_type
end
generate_graphql_name(obj) click to toggle source

Generates a graphql_name from a class name

# File lib/dry/graphql.rb, line 11
def self.generate_graphql_name(obj)
  return obj.graphql_name if obj.respond_to?(:graphql_name)

  obj.name.to_s.capitalize.gsub('DryGraphQLGeneratedTypeForUser', '').gsub('::', '__')
end
register_type_mapping(input_type, output_type) click to toggle source
# File lib/dry/graphql.rb, line 39
def register_type_mapping(input_type, output_type)
  TypeMappings.registry.merge!(input_type => output_type)
end