Class GraphQLAdaptor
Adaptor for handling GraphQL data operations with DataManager. Provides methods to execute GraphQL queries and mutations for CRUD operations.
Inherited Members
Namespace: Syncfusion.Blazor.Data
Assembly: Syncfusion.Blazor.Data.dll
Syntax
public class GraphQLAdaptor : UrlAdaptor
Constructors
GraphQLAdaptor(DataManager)
Initializes a new instance of the GraphQLAdaptor class with the specified DataManager.
Declaration
public GraphQLAdaptor(DataManager dataManager)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager |
Methods
BatchUpdate(DataManager, object, object, object, Utils, IReadOnlyList<string>, int?, Query, object)
Creates a GraphQL request to perform batch operations (update, insert, delete).
Declaration
public override object BatchUpdate(DataManager dataManager, object changed, object added, object deleted, Utils e, IReadOnlyList<string> keyFields, int? dropIndex, Query query = null, object original = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The DataManager instance that manages data operations. |
| object | changed | The collection of records that contain modifications to apply to the data source. |
| object | added | The collection of new records to insert into the data source. |
| object | deleted | The collection of records to remove from the data source. |
| Utils | e | The request information that contains the URL and key details. |
| IReadOnlyList<string> | keyFields | The collection of field names that uniquely identify records. |
| int? | dropIndex | The index at which newly added records are inserted. |
| Query | query | The Query instance that defines additional data operation requirements. The default value is null. |
| object | original | The original record data used to determine changes before processing updates. The default value is null. |
Returns
| Type | Description |
|---|---|
| object | A RequestOptions instance that contains the request information for the batch mutation. |
Overrides
BatchUpdate(DataManager, object, object, object, Utils, string, int?, Query, object)
Creates a GraphQL request to perform batch operations (update, insert, delete).
Declaration
public override object BatchUpdate(DataManager dataManager, object changed, object added, object deleted, Utils e, string keyField, int? dropIndex, Query query = null, object original = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager instance containing the data source. |
| object | changed | Collection of modified records. |
| object | added | Collection of newly added records. |
| object | deleted | Collection of records to delete. |
| Utils | e | Utility object containing URL/key context. |
| string | keyField | Key field name identifying records. |
| int? | dropIndex | Index for insertion. |
| Query | query | Query context and parameters.This parameter is optional. |
| object | original | Original data context used for comparison.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | Returns the configured RequestOptions for the batch mutation. |
Overrides
GetName()
Gets the adaptor name.
Declaration
public override string GetName()
Returns
| Type | Description |
|---|---|
| string | The adaptor name. |
Overrides
Insert(DataManager, object, string, Query, int)
Creates a GraphQL request to insert a new record.
Declaration
public override object Insert(DataManager dataManager, object data, string tableName = null, Query query = null, int position = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager instance containing the data source. |
| object | data | Record to insert. |
| string | tableName | Target table name.This parameter is optional. |
| Query | query | Query context and parameters.This parameter is optional. |
| int | position | Position at which to insert the record.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | Returns the configured RequestOptions for the insert mutation. |
Overrides
IsRemote()
Indicates whether the adaptor performs remote operations.
Declaration
public override bool IsRemote()
Returns
| Type | Description |
|---|---|
| bool | Always returns true. |
Overrides
ProcessQuery(DataManagerRequest)
Processes the data request.
Declaration
public override object ProcessQuery(DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManagerRequest | queries | Data Manager request. |
Returns
| Type | Description |
|---|---|
| object | The request options for GraphQL API calls. |
Overrides
ProcessResponse<T>(object, DataManagerRequest)
Processes a GraphQL HTTP response and returns data in the expected format.
Declaration
public override Task<object> ProcessResponse<T>(object data, DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| object | data | HTTP response message. |
| DataManagerRequest | queries | DataManager request containing query operations |
Returns
| Type | Description |
|---|---|
| Task<object> | Returns DataResult when counts are required; otherwise returns the result data. |
Type Parameters
| Name |
|---|
| T |
Overrides
Remove(DataManager, IDictionary<string, object?>, string, Query)
Creates a GraphQL request to remove a record.
Declaration
public override object Remove(DataManager dataManager, IDictionary<string, object?> keyValues, string tableName = null, Query query = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The DataManager instance that manages data operations. |
| IDictionary<string, object> | keyValues | A dictionary containing the field names and values that uniquely identify the record to remove. |
| string | tableName | The name of the table that contains the record to remove. The default value is null. |
| Query | query | The Query instance that defines additional data operation requirements. The default value is null. |
Returns
| Type | Description |
|---|---|
| object | A RequestOptions instance that contains the request information for the delete mutation. |
Overrides
Remove(DataManager, string, object, string, Query)
Creates a GraphQL request to remove a record.
Declaration
public override object Remove(DataManager dataManager, string keyField, object value, string tableName = null, Query query = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager instance containing the data source. |
| string | keyField | Key field name identifying the record. |
| object | value | Key value of the record to remove. |
| string | tableName | Target table name.This parameter is optional. |
| Query | query | Query context and parameters.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | Returns the configured RequestOptions for the delete mutation. |
Overrides
Update(DataManager, IReadOnlyList<string>, object, string, Query, object, IDictionary<string, object>)
Creates a GraphQL request to update an existing record.
Declaration
public override object Update(DataManager dataManager, IReadOnlyList<string> keyFields, object data, string tableName = null, Query query = null, object original = null, IDictionary<string, object> updateProperties = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The DataManager instance that manages data operations. |
| IReadOnlyList<string> | keyFields | The collection of field names that uniquely identify the record to update. |
| object | data | The record containing the values to update. |
| string | tableName | The name of the table that contains the record to update. The default value is null. |
| Query | query | The Query instance that defines additional data operation requirements. The default value is null. |
| object | original | The original record data used to determine changes before updating the record. The default value is null. |
| IDictionary<string, object> | updateProperties | A dictionary that contains the field names and values to update. The default value is null. |
Returns
| Type | Description |
|---|---|
| object | A RequestOptions instance that contains the request information for the update mutation. |
Overrides
Update(DataManager, string, object, string, Query, object, IDictionary<string, object>)
Creates a GraphQL request to update an existing record.
Declaration
public override object Update(DataManager dataManager, string keyField, object data, string tableName = null, Query query = null, object original = null, IDictionary<string, object> updateProperties = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager instance containing the data source. |
| string | keyField | Key field name identifying the record. |
| object | data | Record with updated values. |
| string | tableName | Target table name.This parameter is optional. |
| Query | query | Query context and parameters.This parameter is optional. |
| object | original | Original record before updates.This parameter is optional. |
| IDictionary<string, object> | updateProperties | Properties to update when provided.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | Returns the configured RequestOptions for the update mutation. |