We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e40141b commit 0075b99Copy full SHA for 0075b99
packages/graphql/src/schema/buildObjectType.ts
@@ -432,8 +432,11 @@ export function buildObjectType({
432
const createPopulationPromise = async (relatedDoc, i) => {
433
let id = relatedDoc
434
let collectionSlug = field.relationTo
435
+ const isValidGraphQLCollection = isRelatedToManyCollections
436
+ ? graphQLCollections.some((collection) => collectionSlug.includes(collection.slug))
437
+ : graphQLCollections.some((collection) => collectionSlug === collection.slug)
438
- if (graphQLCollections.some((collection) => collection.slug === collectionSlug)) {
439
+ if (isValidGraphQLCollection) {
440
if (isRelatedToManyCollections) {
441
collectionSlug = relatedDoc.relationTo
442
id = relatedDoc.value
0 commit comments