From 70bee863cf9915f3b018259505ed568b760a3ee7 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 16 Mar 2021 11:54:48 +0100 Subject: [PATCH] Graphql fixes. --- .../Contents/GraphQL/Types/Contents/SchemaInfos.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Contents/SchemaInfos.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Contents/SchemaInfos.cs index 29dff9125..bc403315f 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Contents/SchemaInfos.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Contents/SchemaInfos.cs @@ -144,6 +144,15 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Contents internal sealed class Names { + // Reserver names that are used for other GraphQL types. + private static readonly HashSet ReservedNames = new HashSet(StringComparer.OrdinalIgnoreCase) + { + "Content", + "Asset", + "AssetResultDto", + "EntitySavedResultDto", + "JsonScalar" + }; private readonly Dictionary takenNames = new Dictionary(); public string this[IField field] @@ -164,7 +173,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Contents { name = "gql_" + name; } - else if (name.Equals("Content", StringComparison.OrdinalIgnoreCase) && isEntity) + else if (ReservedNames.Contains(name) && isEntity) { name = $"{name}Entity"; }