Sha256: bdde77ea27bb41d1f41ca71f71c4dc453159dfc86d667079ed2502597b5505b6

Contents?: true

Size: 616 Bytes

Versions: 35

Compression:

Stored size: 616 Bytes

Contents

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

        target.arguments[name.to_s] = argument
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
graphql-1.1.0 lib/graphql/define/assign_argument.rb
graphql-1.0.0 lib/graphql/define/assign_argument.rb
graphql-0.19.4 lib/graphql/define/assign_argument.rb
graphql-0.19.3 lib/graphql/define/assign_argument.rb
graphql-0.19.2 lib/graphql/define/assign_argument.rb
graphql-0.19.1 lib/graphql/define/assign_argument.rb
graphql-0.19.0 lib/graphql/define/assign_argument.rb
graphql-0.18.15 lib/graphql/define/assign_argument.rb
graphql-0.18.14 lib/graphql/define/assign_argument.rb
graphql-0.18.13 lib/graphql/define/assign_argument.rb
graphql-0.18.12 lib/graphql/define/assign_argument.rb
graphql-0.18.11 lib/graphql/define/assign_argument.rb
graphql-0.18.10 lib/graphql/define/assign_argument.rb
graphql-0.18.9 lib/graphql/define/assign_argument.rb
graphql-0.18.8 lib/graphql/define/assign_argument.rb
graphql-0.18.7 lib/graphql/define/assign_argument.rb
graphql-0.18.6 lib/graphql/define/assign_argument.rb
graphql-0.18.5 lib/graphql/define/assign_argument.rb
graphql-0.18.4 lib/graphql/define/assign_argument.rb
graphql-0.18.3 lib/graphql/define/assign_argument.rb