简体   繁体   English

药剂苦艾酒in input_object

[英]Elixir Absinthe input_object

Why input_object in Elixir Absinthe is not working? 为什么苦艾酒中的input_object无法正常工作?

like 喜欢

   input_object :vehicle_detail do
    field :registrationNo, :string
    field :imageUrl, :string
   end

  mutation do
    field :create_user, type: :user do
        arg :vehicle_details, :vehicle_detail

        resolve &Resolver.create_employee/2
    end
  end

I tried but it is throwing errors for the following payload 我试过了,但以下有效载荷引发错误

mutation() {
  employee: createEmployee(vehicleDetails: {
      registrationNo: "AP03EY0096",
      imageUrl: "http://sample.example.com"
  }) {
    id
  }
}

Errors 失误

In field \"vehicleDetails\": Expected type \"VehicleDetail\", found $vehicleDetails.\nIn field \"imageUrl\": Unknown field.\nIn field \"registrationNo\": Unknown field.",

please try to use atoms in snake case for input object definition: 请尝试使用蛇形原子的原子作为输入对象的定义:

  input_object :vehicle_detail do
    field(:registration_no, :string)
    field(:image_url, :string)
  end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM