From 15ffe6bd3f84abf41b1477de554573bc4bd40f29 Mon Sep 17 00:00:00 2001 From: Azri Kahar <42867097+azrikahar@users.noreply.github.com> Date: Sat, 25 Dec 2021 02:21:49 +0800 Subject: [PATCH] check system deny list in relations for GraphQL (#10674) --- api/src/services/graphql.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/src/services/graphql.ts b/api/src/services/graphql.ts index a61f8a62cc..7ac20d8de6 100644 --- a/api/src/services/graphql.ts +++ b/api/src/services/graphql.ts @@ -467,6 +467,8 @@ export class GraphQLService { for (const relation of schema[action].relations) { if (relation.related_collection) { + if (SYSTEM_DENY_LIST.includes(relation.related_collection)) continue; + CollectionTypes[relation.collection]?.addFields({ [relation.field]: { type: CollectionTypes[relation.related_collection], @@ -931,6 +933,8 @@ export class GraphQLService { for (const relation of schema.read.relations) { if (relation.related_collection) { + if (SYSTEM_DENY_LIST.includes(relation.related_collection)) continue; + ReadableCollectionFilterTypes[relation.collection]?.addFields({ [relation.field]: ReadableCollectionFilterTypes[relation.related_collection], });