Class GraphQLMutation
Represents a collection of mutations used to perform CRUD operations in a GraphQL service.
Inheritance
Namespace: Syncfusion.Blazor.Data
Assembly: Syncfusion.Blazor.dll
Syntax
public class GraphQLMutation : Object
Constructors
GraphQLMutation()
Declaration
public GraphQLMutation()
Properties
Batch
Defines the mutation used to perform CRUD operation Synchronously in GraphQL service.
Declaration
public string Batch { get; set; }
Property Value
Type | Description |
---|---|
System.String | This property holds the GraphQL mutation query for bulk changes in the GraphQL service. The mutation query should be formatted according to the GraphQL syntax and enable CRUD operations Synchronously. |
Remarks
The Batch
property allows you to specify the GraphQL mutation bacth query to perform CRUD operation in the GraphQL service.
The following parameters are passed in the Batch query string,
changed
- Specifies the collection of record to be updated.
added
- Specifies the collection of record to be inserted.
deleted
- Specifies the collection of record to be removed.
action
- Indicates the type of operation being performed.
primaryColumnName
- The primaryColumnName specifies the field name of the primary column.
additionalParameters
- An optional parameter that can be used to perform additional operations.
dropIndex
- Specifies the record position, from which new records will be added while performing row drag and drop.
Examples
<SfDataManager Url=https://localhost:7140/graphql GraphQLAdaptorOptions=@AdaptorOptions Adaptor="Adaptors.GraphQLAdaptor">
</SfDataManager>
@code{
private GraphQLAdaptorOptions AdaptorOptions { get; set; } = new GraphQLAdaptorOptions
{
Mutation = new GraphQLMutation
{
Batch = @"
mutation batch($changed: [OrderInput!], $added: [OrderInput!], $deleted: [OrderInput!], $action: String!, $primaryColumnName: String!, $additionalParameters: Any, , $dropIndex: Int!) {
batchUpdate(changed: $changed, added: $added, deleted: $deleted, action: $action, keyField :$primaryColumnName, additionalParameters: $additionalParameters, dropIndex: $dropIndex) {
OrderID, EmployeeID, Freight, OrderDate
}
}"
}
}
Delete
Defines the mutation used to perform delete operation in GraphQL service.
Declaration
public string Delete { get; set; }
Property Value
Type | Description |
---|---|
System.String | This property holds the GraphQL mutation query for deleting the data in the GraphQL service. The mutation query should be formatted according to the GraphQL syntax and enable deleting the existing data in the service. |
Remarks
The Delete
property allows you to specify the GraphQL mutation delete query to perform delete operation in the GraphQL service.
The following parameters are passed in the Delete query string,
primaryColumnValue
- The primaryColumnValue specifies the primary column value which is needs to be removed from the collection.
action
Indicates the type of operation being performed.
primaryColumnName
- The primaryColumnName specifies the field name of the primary column.
additionalParameters
- An optional parameter that can be used to perform additional operations.
Examples
<SfDataManager Url=https://localhost:7140/graphql GraphQLAdaptorOptions=@AdaptorOptions Adaptor="Adaptors.GraphQLAdaptor">
</SfDataManager>
@code{
private GraphQLAdaptorOptions AdaptorOptions { get; set; } = new GraphQLAdaptorOptions
{
Mutation = new GraphQLMutation
{
Delete = @"
mutation delete($primaryColumnValue: Int!, $action: String!, $primaryColumnName: String!, $additionalParameters: Any) {
deleteOrder(id: $ primaryColumnValue, action: $action, keyField: $primaryColumnName, additionalParameters: $additionalParameters) {
OrderID, EmployeeID, Freight, OrderDate
}
}"
}
}
Insert
Defines the mutation used to perform an insert operation in a GraphQL service.
Declaration
public string Insert { get; set; }
Property Value
Type | Description |
---|---|
System.String | This property holds the GraphQL mutation query for data insertion in the GraphQL service. The mutation query should be formatted according to the GraphQL syntax and enable inserting data into the service. |
Remarks
The Insert
property allows you to specify the GraphQL mutation insert query to perform data insertion in the GraphQL service.
The following parameters are passed in the Insert query string,
record
- The new record which is need to be inserted.
index
- Specifies the index at which the newly added record will be inserted.
action
- Indicates the type of operation being performed.
additionalParameters
- An optional parameter that can be used to perform additional operations.
Examples
<SfDataManager Url=https://localhost:7140/graphql GraphQLAdaptorOptions=@AdaptorOptions Adaptor="Adaptors.GraphQLAdaptor">
</SfDataManager>
@code{
private GraphQLAdaptorOptions AdaptorOptions { get; set; } = new GraphQLAdaptorOptions
{
Mutation = new GraphQLMutation
{
Insert = @"
mutation insert($record: OrderInput!, $index: Int!, $action: String!, $additionalParameters: Any) {
insertOrder(order: $record, position: $index, action: $action, additionalParameters: $additionalParameters) {
OrderID, EmployeeID, Freight, OrderDate
}
}"
}
}
Update
Defines the mutation used to perform an update operation in a GraphQL service.
Declaration
public string Update { get; set; }
Property Value
Type | Description |
---|---|
System.String | This property holds the GraphQL mutation query for updating data in the GraphQL service. The mutation query should be formatted according to the GraphQL syntax and enable updating existing data in the service. |
Remarks
The Update
property allows you to specify the GraphQL mutation update query to perform data updation in the GraphQL service.
The following parameters are passed in the Update query string,
record
- The new record which is need to be updated.
action
- Indicates the type of operation being performed.
primaryColumnName
- The primaryColumnName specifies the field name of the primary column.
primaryColumnValue
- The primaryColumnValue specifies the primary column value which is needs to be updated in the collection.
additionalParameters
- An optional parameter that can be used to perform additional operations.
Examples
<SfDataManager Url=https://localhost:7140/graphql GraphQLAdaptorOptions=@AdaptorOptions Adaptor="Adaptors.GraphQLAdaptor">
</SfDataManager>
@code{
private GraphQLAdaptorOptions AdaptorOptions { get; set; } = new GraphQLAdaptorOptions
{
Mutation = new GraphQLMutation
{
Update = @"
mutation update($record: OrderInput!, $action: String!, $primaryColumnName: String!, $primaryColumnValue: Int!, $additionalParameters: Any) {
updateOrder(order: $record, action: $action, keyField: $primaryColumnName, keyValue: $primaryColumnValue, additionalParameters: $additionalParameters) {
OrderID, EmployeeID, Freight, OrderDate
}
}"
}
}