我需要传递一个ids
数组或一组对象。我怎么能通过呢?
field :deleteDispatches, Types::DispatchType do
argument :route_id, !types.ID
argument :dispatches_id, ![types.ID] #doesn't work
argument :dispatches, [Types::DispatchType] #doesn't work
答案 0 :(得分:1)
您可以使用此代码ids
传递argument :dispatches_id, !types[types.ID]
数组。
答案 1 :(得分:0)
您需要输入对象进行分派,例如Inputs::DispatchInput
field :deleteDispatches, Types::DispatchType do
argument :route_id, !types.ID
argument :dispatches_id, !types[types.ID]
argument :dispatches, types[Inputs::DispatchInput]
Inputs :: DispatchInput:
# inputs/dispatch_input.rb
module Inputs
class FilterInput < Types::BaseInputObject
argument :id, Int, required: true
argument :name, String, required: false
end
end