diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLModel.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLModel.cs index 7bcd837bc..54fff83b8 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLModel.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLModel.cs @@ -84,16 +84,20 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL { var schema = new GraphQLSchema { - Query = - new AppQueriesGraphType( - model, - pageSizeContents, - pageSizeAssets, - schemas - ), - Mutation = new AppMutationsGraphType(model, schemas) + Query = new AppQueriesGraphType( + model, + pageSizeContents, + pageSizeAssets, + schemas) }; + var schemasWithFields = schemas.Where(x => x.SchemaDef.Fields.Count > 0); + + if (schemasWithFields.Any()) + { + schema.Mutation = new AppMutationsGraphType(model, schemasWithFields); + } + return schema; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs index 1d3964f7e..93e7465e3 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs @@ -49,7 +49,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types { Name = "id", Description = "The id of the asset (GUID).", - DefaultValue = string.Empty, + DefaultValue = null, ResolvedType = AllTypes.NonNullGuid } }; @@ -88,14 +88,14 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types { Name = "filter", Description = "Optional OData filter.", - DefaultValue = string.Empty, + DefaultValue = null, ResolvedType = AllTypes.String }, new QueryArgument(AllTypes.None) { Name = "orderby", Description = "Optional OData order definition.", - DefaultValue = string.Empty, + DefaultValue = null, ResolvedType = AllTypes.String } }; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentActions.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentActions.cs index 6637ffacd..2c5a2b763 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentActions.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentActions.cs @@ -69,7 +69,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types { Name = "id", Description = "The id of the content (GUID).", - DefaultValue = string.Empty, + DefaultValue = null, ResolvedType = AllTypes.NonNullGuid } }; @@ -108,21 +108,21 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types { Name = "filter", Description = "Optional OData filter.", - DefaultValue = string.Empty, + DefaultValue = null, ResolvedType = AllTypes.String }, new QueryArgument(AllTypes.None) { Name = "orderby", Description = "Optional OData order definition.", - DefaultValue = string.Empty, + DefaultValue = null, ResolvedType = AllTypes.String }, new QueryArgument(AllTypes.None) { Name = "search", Description = "Optional OData full text search.", - DefaultValue = string.Empty, + DefaultValue = null, ResolvedType = AllTypes.String } }; @@ -186,7 +186,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types { Name = "id", Description = "The id of the content (GUID)", - DefaultValue = string.Empty, + DefaultValue = null, ResolvedType = AllTypes.NonNullGuid }, new QueryArgument(AllTypes.None) @@ -231,21 +231,21 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types { Name = "id", Description = "The id of the content (GUID)", - DefaultValue = string.Empty, + DefaultValue = null, ResolvedType = AllTypes.NonNullGuid }, new QueryArgument(AllTypes.None) { Name = "status", Description = "The new status", - DefaultValue = string.Empty, + DefaultValue = null, ResolvedType = AllTypes.NonNullString }, new QueryArgument(AllTypes.None) { Name = "dueTime", Description = "When to change the status", - DefaultValue = EtagVersion.Any, + DefaultValue = null, ResolvedType = AllTypes.Date }, new QueryArgument(AllTypes.None) @@ -275,7 +275,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types { Name = "id", Description = "The id of the content (GUID)", - DefaultValue = string.Empty, + DefaultValue = null, ResolvedType = AllTypes.NonNullGuid }, new QueryArgument(AllTypes.None) diff --git a/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj b/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj index 7ee7c2063..5a3a325c3 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj +++ b/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj @@ -24,7 +24,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/backend/src/Squidex/Squidex.csproj b/backend/src/Squidex/Squidex.csproj index 2132fe330..bb67eb9a9 100644 --- a/backend/src/Squidex/Squidex.csproj +++ b/backend/src/Squidex/Squidex.csproj @@ -35,7 +35,7 @@ - + diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj index c6c1285cb..4f196ca61 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj @@ -19,8 +19,8 @@ - - + + diff --git a/frontend/app/shared/components/app-form.component.html b/frontend/app/shared/components/app-form.component.html index db3132311..a573c4548 100644 --- a/frontend/app/shared/components/app-form.component.html +++ b/frontend/app/shared/components/app-form.component.html @@ -39,7 +39,7 @@ + \ No newline at end of file