KGraphQL icon indicating copy to clipboard operation
KGraphQL copied to clipboard

LocalDate when passed as query variable

Open shamresh opened this issue 7 years ago • 1 comments

Hi,

If I do

query getNewInventoryQuery($vin: String!, $fromDate: LocalDate!) {

   parts: getInventory(stockNumber :"XXX-2343-1", fromDate: $fromDate){
    		restockDate
    		stockNumber
        parts {
          oem
          addedDate
          manufacturer
          name
        }
  }
}

and the query variable is:

{
  "vin": "4T3BK3BB1CU070903",
  "fromDate": "1999-12-12"
}

I get :

{ "errors": { "message": "Caught ExecutionException: Failed to coerce 1999-12-12 as java.time.LocalDate" } }

However, if I do not pass the LocalDate and hard code it as :

query getNewInventoryQuery($vin: String!, $fromDate: LocalDate!) {

   parts: getInventory(stockNumber :"XXX-2343-1", fromDate: "1999-12-12"){
    		restockDate
    		stockNumber
        parts {
          oem
          addedDate
          manufacturer
          name
        }
  }
}

the query works.

shamresh avatar Jan 30 '19 04:01 shamresh

This has been fixed with: https://github.com/pgutkowski/KGraphQL/pull/46 But a new version with this fix hasn't been released yet.

jeggy avatar Jan 30 '19 09:01 jeggy