Uploaded image for project: 'Magnolia GraphQL'
  1. Magnolia GraphQL
  2. MGNLGQL-81

lastModified property of assets returns error

XMLWordPrintable

      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

        Acceptance criteria

              lam.nguyen Lam Nguyen Bao
              czimmermann Christopher Zimmermann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 1d 5h 20m
                    1d 5h 20m