Sha256: beb229f8deafa6feeaf7f79ad76415c9654b4893d1227a73dec78b6a752df3c4

Contents?: true

Size: 563 Bytes

Versions: 2

Compression:

Stored size: 563 Bytes

Contents

module GraphQL
  module Define
    # Turn argument configs into a {GraphQL::Argument}.
    module AssignArgument
      def self.call(target, name, type, description = nil, default_value: nil, &block)
        argument = if block_given?
          GraphQL::Argument.define(&block)
        else
          GraphQL::Argument.new
        end
        argument.name = name.to_s
        argument.type = type
        argument.description = description
        argument.default_value = default_value
        target.arguments[name.to_s] = argument
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
graphql-0.12.1 lib/graphql/define/assign_argument.rb
graphql-0.12.0 lib/graphql/define/assign_argument.rb