Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Graphql query of content fragments not returning single Fragment Reference field in cloud server. What could cause this?

Avatar

Level 4

We have a number of content fragment models that reference other content fragments and which we return using API calls. One of our cloud environments started failing to return results for a referenced model. This is an example of what that looks like. I've simplified and made this more generic than it is in reality. So for a query like this:

 

{
  myObjectList(limit: 10) {
    items {
      jcrName
      _path
      _model {
        _path
      }
      subtitle {
        html
      }
      description {
        html
      }
      features {
        jcrName
        _path
        _model {
          _path
        }
        description {
          html
        }
      }
    }
  }
}

 

in all other environments we get a result like this:

{
  "data": {
    "myObjectList": {
      "items": [
        {
          "jcrName": "the-object-name,
          "_path": "/content/dam/...",
          "_model": {
            "_path": "/conf/myproject/settings/dam/cfm/models/myObject"
          },
          "subtitle": {
            "html": "<p>Object Instance 1</p>"
          },
          "description": {
            "html": null
          },
          "features": [
            {
              "jcrName": "my-feature-1",
              "_path": "/content/dam/myproject/my-feature-1",
              "_model": {
                "_path": "/conf/myproject/settings/dam/cfm/models/features"
              },
              "description": {
                "html": "<p>My feature 1</p>"
              }
            }
         ]
        }
      ]
    }
  }
}

 

Then on this 1 server we're getting a result like this for the same query:

 

{
  "data": {
    "myObjectList": {
      "items": [
        {
          "jcrName": "the-object-name,
          "_path": "/content/dam/...",
          "_model": {
            "_path": "/conf/myproject/settings/dam/cfm/models/myObject"
          },
          "subtitle": {
            "html": "<p>Object Instance 1</p>"
          },
          "description": {
            "html": null
          },
          "features": []
        }
      ]
    }
  }
}

 

so basically this one server doesn't return the referenced fragment "Feature". 

 

So far what I've tried is:

1. Deleting and recreating the content

2. Reimporting the content from package from another environment

3. Followed directions here to try to force the fragments to be indexed

 

Nothing is working. Does this problem look familiar to anyone? 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 4

Regrettably this seems to be a bug with a particular version of GraphQL in the environments. The team at AEM Cloud Services rolled back to an older version of the environment and the GraphQL query began working again. I would love to know what the underlying cause is, though. 

View solution in original post

5 Replies

Avatar

Level 7

Hi @Preston ,

Looks like there is some issue with the CF model that is being referenced by the path ''/conf/myproject/settings/dam/cfm/models/features". Make sure 'features' CFM is present in the environment where you're unable to fetch the response.

Thanks,
Madhur

Avatar

Level 4

There's nothing in the logs relating to the underlying GraphQL that we can see. 

Avatar

Correct answer by
Level 4

Regrettably this seems to be a bug with a particular version of GraphQL in the environments. The team at AEM Cloud Services rolled back to an older version of the environment and the GraphQL query began working again. I would love to know what the underlying cause is, though.