[SOLVED] GraphQL referencing returning empty array

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [x] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

When I make the following GraphQL query I expect the referencingLeafContents array not to be empty.

{
  root: queryRootContents {
    id
    referencingLeafContents {
      id
    }
  }
}

Expected behavior

When I make the above GraphQL query the referencingLeafContents is empty.

{
  "data": {
    "root": [
      {
        "id": "29f04712-f04f-47c8-ac31-d6b6d302ade1",
        "referencingLeafContents": []
      }
    ]
  }
}

Minimal reproduction of the problem

The app “test-referencing” has the following schema.

Root schema

{
    "properties": {},
    "scripts": {},
    "fieldsInLists": [],
    "fieldsInReferences": [],
    "fields": [
        {
            "name": "prop",
            "properties": {
                "isRequired": true,
                "fieldType": "String",
                "editor": "Input",
                "contentType": "Unspecified"
            },
            "partitioning": "invariant"
        }
    ],
    "isPublished": true
}

"Leaf" schema

{
    "properties": {},
    "scripts": {},
    "fieldsInLists": [],
    "fieldsInReferences": [],
    "fields": [
        {
            "name": "parent",
            "properties": {
                "isRequired": true,
                "fieldType": "References",
                "editor": "Dropdown",
                "minItems": 1,
                "maxItems": 1,
                "resolveReference": true,
                "schemaIds": [
                    "d69e7d2c-8ba2-4071-ae49-b0399bc58ffd"
                ]
            },
            "partitioning": "invariant"
        }
    ],
    "isPublished": true
}
  • Create a Root entity on the Root collection
  • Create a Leaf entity on the Leaf collection

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [x] Cloud version

Version: [VERSION]

Browser:

  • [x] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

The tabs “References” and “Referencing” of every created entity are also empty.

Thats weird, I will have a look.

I can reproduce it and can probably provide a fix this week. But a full fix requires to repopulate the content items. I can schedule it for next week.

Thanks Sebastian.

Just to confirm. Does the repopulate happens for every application on squidex? Or do you need to run it per application?

It happens for all applications together. I have to announce it, then put Squidex to read only mode and start the migration. Like the last time. usually it is no problem to do this without downtimes but I have to plan it properly.

1 Like

I have also realized that there were no tests in the API tests for this case. I have added it. The API tests run on a test environment for each build and ensure that the API is not broken. Sometimes all unit tests are green and you still have bugs :frowning:

This topic was automatically closed after 2 days. New replies are no longer allowed.