|
|
@ -8,6 +8,7 @@ |
|
|
using GraphQL.Types; |
|
|
using GraphQL.Types; |
|
|
using Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Contents; |
|
|
using Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Contents; |
|
|
using Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Primitives; |
|
|
using Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Primitives; |
|
|
|
|
|
using Squidex.Domain.Apps.Entities.Schemas; |
|
|
|
|
|
|
|
|
namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types; |
|
|
namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types; |
|
|
|
|
|
|
|
|
@ -34,69 +35,79 @@ internal sealed class ApplicationMutations : ObjectGraphType |
|
|
|
|
|
|
|
|
var nonNullContentType = new NonNullGraphType(contentType); |
|
|
var nonNullContentType = new NonNullGraphType(contentType); |
|
|
|
|
|
|
|
|
AddField(new FieldType |
|
|
// Calculate the named if once to avoid allocations.
|
|
|
|
|
|
var schemaid = schemaInfo.Schema.NamedId(); |
|
|
|
|
|
|
|
|
|
|
|
AddField(new FieldTypeWithSchemaNamedId |
|
|
{ |
|
|
{ |
|
|
Name = $"create{schemaInfo.TypeName}Content", |
|
|
Name = $"create{schemaInfo.TypeName}Content", |
|
|
Arguments = ContentActions.Create.Arguments(inputType), |
|
|
Arguments = ContentActions.Create.Arguments(inputType), |
|
|
ResolvedType = contentType, |
|
|
ResolvedType = contentType, |
|
|
Resolver = ContentActions.Create.Resolver, |
|
|
Resolver = ContentActions.Create.Resolver, |
|
|
Description = $"Creates an {schemaInfo.DisplayName} content." |
|
|
Description = $"Creates an {schemaInfo.DisplayName} content.", |
|
|
}).WithSchemaNamedId(schemaInfo); |
|
|
SchemaId = schemaInfo.Schema.NamedId() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
AddField(new FieldType |
|
|
AddField(new FieldTypeWithSchemaNamedId |
|
|
{ |
|
|
{ |
|
|
Name = $"update{schemaInfo.TypeName}Content", |
|
|
Name = $"update{schemaInfo.TypeName}Content", |
|
|
Arguments = ContentActions.Update.Arguments(inputType), |
|
|
Arguments = ContentActions.Update.Arguments(inputType), |
|
|
ResolvedType = contentType, |
|
|
ResolvedType = contentType, |
|
|
Resolver = ContentActions.Update.Resolver, |
|
|
Resolver = ContentActions.Update.Resolver, |
|
|
Description = $"Update an {schemaInfo.DisplayName} content by id." |
|
|
Description = $"Update an {schemaInfo.DisplayName} content by id.", |
|
|
}).WithSchemaNamedId(schemaInfo); |
|
|
SchemaId = schemaInfo.Schema.NamedId() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
AddField(new FieldType |
|
|
AddField(new FieldTypeWithSchemaNamedId |
|
|
{ |
|
|
{ |
|
|
Name = $"upsert{schemaInfo.TypeName}Content", |
|
|
Name = $"upsert{schemaInfo.TypeName}Content", |
|
|
Arguments = ContentActions.Upsert.Arguments(inputType), |
|
|
Arguments = ContentActions.Upsert.Arguments(inputType), |
|
|
ResolvedType = contentType, |
|
|
ResolvedType = contentType, |
|
|
Resolver = ContentActions.Upsert.Resolver, |
|
|
Resolver = ContentActions.Upsert.Resolver, |
|
|
Description = $"Upsert an {schemaInfo.DisplayName} content by id." |
|
|
Description = $"Upsert an {schemaInfo.DisplayName} content by id.", |
|
|
}).WithSchemaNamedId(schemaInfo); |
|
|
SchemaId = schemaInfo.Schema.NamedId() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
AddField(new FieldType |
|
|
AddField(new FieldTypeWithSchemaNamedId |
|
|
{ |
|
|
{ |
|
|
Name = $"patch{schemaInfo.TypeName}Content", |
|
|
Name = $"patch{schemaInfo.TypeName}Content", |
|
|
Arguments = ContentActions.Patch.Arguments(inputType), |
|
|
Arguments = ContentActions.Patch.Arguments(inputType), |
|
|
ResolvedType = contentType, |
|
|
ResolvedType = contentType, |
|
|
Resolver = ContentActions.Patch.Resolver, |
|
|
Resolver = ContentActions.Patch.Resolver, |
|
|
Description = $"Patch an {schemaInfo.DisplayName} content by id." |
|
|
Description = $"Patch an {schemaInfo.DisplayName} content by id.", |
|
|
}).WithSchemaNamedId(schemaInfo); |
|
|
SchemaId = schemaInfo.Schema.NamedId() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
AddField(new FieldType |
|
|
AddField(new FieldTypeWithSchemaNamedId |
|
|
{ |
|
|
{ |
|
|
Name = $"change{schemaInfo.TypeName}Content", |
|
|
Name = $"change{schemaInfo.TypeName}Content", |
|
|
Arguments = ContentActions.ChangeStatus.Arguments, |
|
|
Arguments = ContentActions.ChangeStatus.Arguments, |
|
|
ResolvedType = contentType, |
|
|
ResolvedType = contentType, |
|
|
Resolver = ContentActions.ChangeStatus.Resolver, |
|
|
Resolver = ContentActions.ChangeStatus.Resolver, |
|
|
Description = $"Change a {schemaInfo.DisplayName} content." |
|
|
Description = $"Change a {schemaInfo.DisplayName} content.", |
|
|
}).WithSchemaNamedId(schemaInfo); |
|
|
SchemaId = schemaInfo.Schema.NamedId() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
AddField(new FieldType |
|
|
AddField(new FieldTypeWithSchemaNamedId |
|
|
{ |
|
|
{ |
|
|
Name = $"delete{schemaInfo.TypeName}Content", |
|
|
Name = $"delete{schemaInfo.TypeName}Content", |
|
|
Arguments = ContentActions.Delete.Arguments, |
|
|
Arguments = ContentActions.Delete.Arguments, |
|
|
ResolvedType = EntitySavedGraphType.NonNull, |
|
|
ResolvedType = EntitySavedGraphType.NonNull, |
|
|
Resolver = ContentActions.Delete.Resolver, |
|
|
Resolver = ContentActions.Delete.Resolver, |
|
|
Description = $"Delete an {schemaInfo.DisplayName} content." |
|
|
Description = $"Delete an {schemaInfo.DisplayName} content.", |
|
|
}).WithSchemaNamedId(schemaInfo); |
|
|
SchemaId = schemaInfo.Schema.NamedId() |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
AddField(new FieldType |
|
|
AddField(new FieldTypeWithSchemaNamedId |
|
|
{ |
|
|
{ |
|
|
Name = $"publish{schemaInfo.TypeName}Content", |
|
|
Name = $"publish{schemaInfo.TypeName}Content", |
|
|
Arguments = ContentActions.ChangeStatus.Arguments, |
|
|
Arguments = ContentActions.ChangeStatus.Arguments, |
|
|
ResolvedType = contentType, |
|
|
ResolvedType = contentType, |
|
|
Resolver = ContentActions.ChangeStatus.Resolver, |
|
|
Resolver = ContentActions.ChangeStatus.Resolver, |
|
|
Description = $"Publish a {schemaInfo.DisplayName} content.", |
|
|
Description = $"Publish a {schemaInfo.DisplayName} content.", |
|
|
DeprecationReason = $"Use 'change{schemaInfo.TypeName}Content' instead" |
|
|
DeprecationReason = $"Use 'change{schemaInfo.TypeName}Content' instead", |
|
|
}).WithSchemaNamedId(schemaInfo); |
|
|
SchemaId = schemaInfo.Schema.NamedId() |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Description = "The app mutations."; |
|
|
Description = "The app mutations."; |
|
|
|