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

lastModified property of assets returns error

    XMLWordPrintable

Details

    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

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD