发布联系信息时Graphql错误

时间:2019-04-17 06:40:40

标签: angular typescript graphql

我有一个角度形式,我试图使用graphQL发布(更改)客户联系信息。 但是,当我单击提交按钮时,出现此错误。 我尝试使用谷歌搜索,但找不到相关帮助。 有人知道如何解决此错误,或者可以向我解释该怎么做。

Error: GraphQL error: Cannot deserialize value of type `java.util.Date` from String "2019-04-28T18:30:00.000Z": expected format "yyyy-MM-dd'T'HH:mm:ss.SSSZ"

enter image description here

最初,我尝试将联系人信息推送到一个看起来像这样的数组中:

{agreementId: "123", contactType: "phone", contactDescription: "", 
contactSubType: "mobile", contactSubTypeDescription: "", …}
agreementId: "123"
contactDescription: ""
contactSubType: "mobile"
contactSubTypeDescription: ""
contactType: "phone"
endDate: Sun Apr 28 2019 00:00:00 GMT+0530 (India Standard Time) {}
lastVerifiedDate: Thu Apr 11 2019 00:00:00 GMT+0530 (India Standard Time) {}
referenceNumber: "123"
startDate: Fri Apr 19 2019 00:00:00 GMT+0530 (India Standard Time) {}

我正在使用ngModel从Mat-Date选择器中获取Date。 但是,现在当我尝试将此信息发布到graphQl时,它会引发以下错误:

ERROR:
there was an error sending the query Error: GraphQL error: Cannot 
deserialize value of type `java.util.Date` from String "2019-04- 
27T18:30:00.000Z": expected format "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: 
com.statefarm.mdm.model.customer.Customer["contact"]- 
>java.util.ArrayList[0]- 
>com.statefarm.mdm.model.customer.Contact["endDate"])
at new ApolloError (bundle.esm.js:60)
at QueryManager.<anonymous> (bundle.esm.js:980)
at step (tslib.es6.js:97)
at Object.next (tslib.es6.js:78)
at tslib.es6.js:71
at new ZoneAwarePromise (zone.js:891)
at __awaiter (tslib.es6.js:67)
at Object.next (bundle.esm.js:972)
at notifySubscription (Observable.js:130)
at onNotify (Observable.js:165)

0 个答案:

没有答案