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.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, 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, 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, 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. |