From dd5acae76febbe2f3be7440dff569cf24491b59b Mon Sep 17 00:00:00 2001 From: James Date: Fri, 11 Sep 2020 14:11:23 -0400 Subject: [PATCH] only sets nullable gql type if no admin condition --- src/graphql/schema/withNullableType.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graphql/schema/withNullableType.js b/src/graphql/schema/withNullableType.js index 739c382a38..171d727357 100644 --- a/src/graphql/schema/withNullableType.js +++ b/src/graphql/schema/withNullableType.js @@ -2,8 +2,9 @@ const { GraphQLNonNull } = require('graphql'); const withNullableType = (field, type) => { const hasReadAccessControl = field.access && field.access.read; + const condition = field.admin && field.admin.condition; - if (field.required && !field.localized && !hasReadAccessControl) { + if (field.required && !field.localized && !condition && !hasReadAccessControl) { return new GraphQLNonNull(type); }