Module: Dry::GraphQL::Struct
- Defined in:
- lib/dry/graphql.rb
Overview
Extends Dry::Struct functionality
Instance Method Summary collapse
Instance Method Details
#graphql_type(options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/dry/graphql.rb', line 12 def graphql_type( = {}) return @graphql_type if @graphql_type graphql_name = name.to_s.gsub('::', '__') graphql_schema = SchemaBuilder.build_graphql_schema_class(name) graphql_schema.graphql_name(name) opts = { name: graphql_name, type: schema, schema: graphql_schema, options: } @graphql_type ||= SchemaBuilder.new(opts).graphql_type end |