[MGNLGQL-81] lastModified property of assets returns error Created: 31/Mar/21  Updated: 18/Apr/21  Resolved: 13/Apr/21

Status: Closed
Project: Magnolia GraphQL
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Bug Priority: Major
Reporter: Christopher Zimmermann Assignee: Lam Nguyen Bao
Resolution: Fixed Votes: 0
Labels: VN-Analysis, VN-Maintenance
Remaining Estimate: Not Specified
Time Spent: 1d 5h 20m
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Epic Link: GraphQL Phase 1
Sprint: HL & LD 26
Story Points: 3

 Description   

Steps to reproduce

  1.  Attempt to use a query which retrives the `lastModified` property of assets, for example:
{
    assets{
      fileName
      lastModified
    }
}
  1.  

.. Logs, screenshots, gifs...

Expected results

Get results.

Actual results

Response includes error messages:

{
  "status": 500,
  "errors": [
    {
      "message": "Can't serialize value (/assets[0]/lastModified) : Expected type 'Long' but was 'GregorianCalendar'.",
      "path": [
        "assets",
        0,
        "lastModified"
      ],
      "exception": {
        "cause": null,
        "stackTrace": [
          {
            "methodName": "serialize",
            "fileName": "Scalars.java",
            "lineNumber": 355,
            "className": "graphql.Scalars$6",
            "nativeMethod": false
          },

Log

2021-03-31 09:27:00,417 WARN  notprivacysafe.graphql.execution.ExecutionStrategy: Can't serialize value (/assets[0]/lastModified) : Expected type 'Long' but was 'GregorianCalendar'.
graphql.schema.CoercingSerializeException: Expected type 'Long' but was 'GregorianCalendar'.
	at graphql.Scalars$6.serialize(Scalars.java:355) ~[graphql-java-14.1.jar:?]
	at graphql.Scalars$6.serialize(Scalars.java:327) ~[graphql-java-14.1.jar:?]
	at graphql.execution.ExecutionStrategy.completeValueForScalar(ExecutionStrategy.java:579) ~[graphql-java-14.1.jar:?]

Workaround

Development notes


Generated at Mon Feb 12 05:52:24 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.