这是indexloc提供的服务,不要输入任何密码
Skip to content

null values passed into hasura are not forwarded to the remote schema #9476

@MorningK

Description

@MorningK

Version Information

Server Version: v2.4.0
CLI Version (for CLI related issue):

Environment

Docker

What is the current behaviour?

null values passed into hasura are not forwarded to the remote schema

What is the expected behaviour?

null values are correctly forwarded to the remote schema

How to reproduce the issue?

define mutation in remote schema

  updateHotelSystemWithinHotel(
    id: ID!
    purchaseReceiptExceedQuantityWarnThreshold: BigDecimal
    printPurchaseOrderPrice: Boolean
    printPurchasePendingReceiptPrice: Boolean
  ): HotelSystem!

send request within hasura

mutation {
  updateHotelSystemWithinHotel(
    id: "1"
    purchaseReceiptExceedQuantityWarnThreshold: null
    printPurchaseOrderPrice: true
    printPurchasePendingReceiptPrice: true
  ) {
    id
    purchaseReceiptExceedQuantityWarnThreshold
    printPurchaseOrderPrice
    printPurchasePendingReceiptPrice
  }
}

result

{
  "data": {
    "updateHotelSystemWithinHotel": {
      "id": "1",
      "purchaseReceiptExceedQuantityWarnThreshold": "0.23",
      "printPurchaseOrderPrice": true,
      "printPurchasePendingReceiptPrice": true
    }
  }
}

remote schema log

2023-03-01 18:07:03.605  INFO 20651 --- [nio-8081-exec-2] monitorLog                               : c6bd5445-3449-4455-b12c-e422d11985b8<|>null<|>mutation  { updateHotelSystemWithinHotel(printPurchasePendingReceiptPrice: true,printPurchaseOrderPrice: true,id: "1") { id  purchaseReceiptExceedQuantityWarnThreshold  printPurchaseOrderPrice  printPurchasePendingReceiptPrice  } }<|>{}<|>{"updateHotelSystemWithinHotel":{"id":"1","purchaseReceiptExceedQuantityWarnThreshold":"0.23","printPurchaseOrderPrice":true,"printPurchasePendingReceiptPrice":true}}<|>316

send request without hasura

mutation {
  updateHotelSystemWithinHotel(
    id: "1"
    purchaseReceiptExceedQuantityWarnThreshold: null
    printPurchaseOrderPrice: true
    printPurchasePendingReceiptPrice: true
  ) {
    id
    purchaseReceiptExceedQuantityWarnThreshold
    printPurchaseOrderPrice
    printPurchasePendingReceiptPrice
  }
}

result

{
  "data": {
    "updateHotelSystemWithinHotel": {
      "id": "1",
      "purchaseReceiptExceedQuantityWarnThreshold": null,
      "printPurchaseOrderPrice": true,
      "printPurchasePendingReceiptPrice": true
    }
  }
}

remote schema log

2023-03-01 18:08:20.764  INFO 20651 --- [nio-8081-exec-4] monitorLog                               : eb330b97-53ab-44e4-af1b-cfbc9b4fb2f4<|>null<|>\nmutation {\n  updateHotelSystemWithinHotel(\n    id: "1"\n    purchaseReceiptExceedQuantityWarnThreshold: null\n    printPurchaseOrderPrice: true\n    printPurchasePendingReceiptPrice: true\n  ) {\n    id\n    purchaseReceiptExceedQuantityWarnThreshold\n    printPurchaseOrderPrice\n    printPurchasePendingReceiptPrice\n  }\n}\n<|>{}<|>{"updateHotelSystemWithinHotel":{"id":"1","printPurchaseOrderPrice":true,"printPurchasePendingReceiptPrice":true}}<|>324

Screenshots or Screencast

Please provide any traces or logs that could help here.

hasura log

{"type":"query-log","timestamp":"2023-03-01T10:07:01.335+0000","level":"info","detail":{"kind":"remote-schema","request_id":"a3413c3f-dd6d-41b9-841a-9339ce6aabce","generated_sql":null,"query":{"variables":{},"query":"\nmutation {\n  updateHotelSystemWithinHotel(\n    id: \"1\"\n    purchaseReceiptExceedQuantityWarnThreshold: null\n    printPurchaseOrderPrice: true\n    printPurchasePendingReceiptPrice: true\n  ) {\n    id\n    purchaseReceiptExceedQuantityWarnThreshold\n    printPurchaseOrderPrice\n    printPurchasePendingReceiptPrice\n  }\n}\n"}}}
{"type":"http-log","timestamp":"2023-03-01T10:07:03.843+0000","level":"info","detail":{"operation":{"query_execution_time":2.58882257,"user_vars":{"x-hasura-role":"admin"},"request_id":"a3413c3f-dd6d-41b9-841a-9339ce6aabce","response_size":143,"query":{"variables":{},"operationName":null,"query":"\nmutation {\n  updateHotelSystemWithinHotel(\n    id: \"1\"\n    purchaseReceiptExceedQuantityWarnThreshold: null\n    printPurchaseOrderPrice: true\n    printPurchasePendingReceiptPrice: true\n  ) {\n    id\n    purchaseReceiptExceedQuantityWarnThreshold\n    printPurchaseOrderPrice\n    printPurchasePendingReceiptPrice\n  }\n}\n"},"request_mode":"single","request_read_time":2.033559e-3},"request_id":"a3413c3f-dd6d-41b9-841a-9339ce6aabce","http_info":{"status":200,"http_version":"HTTP/1.1","url":"/v1/graphql","ip":"172.24.0.1","method":"POST","content_encoding":"gzip"}}}

Any possible solutions/workarounds you're aware of?

Keywords

null values remote schema

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions