OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.45k stars 2.41k forks source link

GraphQL Breaks on Orchard Core Version 2.0.2 When Querying Multiple termContentItems #16883

Open vikasmahant69 opened 1 month ago

vikasmahant69 commented 1 month ago

Description

GraphQL queries involving termContentItems are breaking in Orchard Core version 2.0.2 when attempting to fetch multiple records, whereas these same queries were working as expected in version 1.8.3. This issue specifically arises when trying to fetch multiple records of termContentItems in relation to other properties.

Orchard Core version 2.0.2

To Reproduce

Steps to reproduce the behaviour:

  1. Create a GraphQL query fetching any contentItems and its termContentItems.
  2. The query breaks if multiple records for termContentItems are present.

Below is an example of a breaking query: query MyQuery { exhibitor { name filterTags { termContentItems { displayText } } } }

Expected behavior

The query should return all records of termContentItems along with the associated name and filterTags for the exhibitor.

Additional Information

The query works fine when fetching only a single record. Example of a working query that limits the result set:

query MyQuery { exhibitor(first: 10) { name filterTags { termContentItems { displayText } } } }

Notes:

The issue did not exist in version 1.8.3, where the same query returned multiple records without any problem. This suggests a regression or breaking change in version 2.0.2 that affects the handling of multiple termContentItems in GraphQL queries.

Potential Impact:

Users cannot reliably query multiple termContentItems in GraphQL. This affects any Orchard Core instances that have upgraded from 1.8.3 to 2.0.2 and rely on similar GraphQL queries for their functionality.

Logs and screenshots

https://github.com/user-attachments/assets/18fbbf8e-c9e2-4aea-90df-c2f56e145148

sebastienros commented 1 month ago

Extracted the stack trace

image

github-actions[bot] commented 1 month ago

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

gvkries commented 1 week ago

I quickly tried to reproduce this error with the blog theme, but it works flawlessly with the latest main. Could you share your content definitions?