GraphbackDataProvider
Graphback layered architecture component that can be called from the service layer in both RESTFULL and GraphQL middlewares.
Graphback implements server side procesing using following flow:
GraphQL Resolvers
-> GraphbackCRUDService
[1-*] -> GraphbackDataProvider
Data layer can be composable (each provider can reference multiple layers of other providers).
see
GraphbackCRUDService
#
Type parameters▪ Type
#
Hierarchy- GraphbackDataProvider
#
Index#
Methods#
Methods#
batchRead▸ batchRead(relationField
: string, ids
: string[], filter
: QueryFilter, selectedFields?
: string[]): Promise‹Type[][]›
Defined in packages/graphback-core/src/runtime/GraphbackDataProvider.ts:78
Read multiple items by their id's (used for lazy data loading purposes)
Parameters:
Name | Type | Description |
---|---|---|
relationField | string | name of the field that will be used to match ids |
ids | string[] | array of identifiers that needs to be fetched |
filter | QueryFilter | filter by specific type |
selectedFields? | string[] | - |
Returns: Promise‹Type[][]›
#
count▸ count(filter
: QueryFilter): Promise‹number›
Defined in packages/graphback-core/src/runtime/GraphbackDataProvider.ts:68
Implementation for counting number of objects with filtering capabilities
Parameters:
Name | Type | Description |
---|---|---|
filter | QueryFilter | filter by specific type |
Returns: Promise‹number›
#
create▸ create(data
: Type, selectedFields?
: string[]): Promise‹Type›
Defined in packages/graphback-core/src/runtime/GraphbackDataProvider.ts:26
Implementation for object creation
Parameters:
Name | Type | Description |
---|---|---|
data | Type | input data |
selectedFields? | string[] | - |
Returns: Promise‹Type›
#
delete▸ delete(data
: Partial‹Type›, selectedFields?
: string[]): Promise‹Type›
Defined in packages/graphback-core/src/runtime/GraphbackDataProvider.ts:44
Implementation for object deletes
Parameters:
Name | Type | Description |
---|---|---|
data | Partial‹Type› | data used for checking consistency |
selectedFields? | string[] | - |
Returns: Promise‹Type›
#
findBy▸ findBy(args?
: FindByArgs, selectedFields?
: string[]): Promise‹Type[]›
Defined in packages/graphback-core/src/runtime/GraphbackDataProvider.ts:61
Implementation for reading objects with filtering capabilities
Parameters:
Name | Type |
---|---|
args? | FindByArgs |
selectedFields? | string[] |
Returns: Promise‹Type[]›
#
findOne▸ findOne(args
: Partial‹Type›, selectedFields?
: string[]): Promise‹Type›
Defined in packages/graphback-core/src/runtime/GraphbackDataProvider.ts:52
Implementation for finding a single unique object
Parameters:
Name | Type | Description |
---|---|---|
args | Partial‹Type› | filter by unique attriburtes |
selectedFields? | string[] | - |
Returns: Promise‹Type›
#
update▸ update(data
: Partial‹Type›, selectedFields?
: string[]): Promise‹Type›
Defined in packages/graphback-core/src/runtime/GraphbackDataProvider.ts:35
Implementation for object updates
Parameters:
Name | Type | Description |
---|---|---|
data | Partial‹Type› | input data |
selectedFields? | string[] | - |
Returns: Promise‹Type›