Sha256: 8ccbd4d9aa46bbee76a58ba41089ae5e044de7b585ddda922b2d7772c60437d7
Contents?: true
Size: 792 Bytes
Versions: 10
Compression:
Stored size: 792 Bytes
Contents
# frozen_string_literal: true module GraphqlRails module Model # stores information about model specific config, like attributes and types class GrapqhlTypeBuilder def initialize(name:, description: nil, attributes:) @name = name @attributes = attributes @description = description end def call type_name = name type_description = description type_attributes = attributes GraphQL::ObjectType.define do name(type_name) description(type_description) type_attributes.each_value do |attribute| field(*attribute.field_args) end end end private attr_reader :model_configuration, :attributes, :name, :description end end end
Version data entries
10 entries across 10 versions & 1 rubygems