Version: 0.15.x

DataSyncProvider

Type parameters

Type

GraphbackContext

Hierarchy

  • GraphbackDataProvider‹Type›

    DataSyncProvider

Implemented by

Index

Methods

Methods

batchRead

batchRead(relationField: string, ids: string[], filter: any, context: GraphbackContext): Promise‹Type[][]›

Inherited from DataSyncProvider.batchRead

Defined in packages/graphback-core/types/runtime/GraphbackDataProvider.d.ts:70

Read multiple items by their id's (used for lazy data loading purposes)

Parameters:

NameTypeDescription
relationFieldstringname of the field that will be used to match ids
idsstring[]array of identifiers that needs to be fetched
filteranyfilter by specific type
contextGraphbackContextfields to select from datasource

Returns: Promise‹Type[][]›


count

count(filter: any): Promise‹number›

Inherited from DataSyncProvider.count

Defined in packages/graphback-core/types/runtime/GraphbackDataProvider.d.ts:61

Implementation for counting number of objects with filtering capabilities

Parameters:

NameTypeDescription
filteranyfilter by specific type

Returns: Promise‹number›


create

create(data: Type, context: GraphbackContext): Promise‹Type›

Inherited from DataSyncProvider.create

Defined in packages/graphback-core/types/runtime/GraphbackDataProvider.d.ts:23

Implementation for object creation

Parameters:

NameTypeDescription
dataTypeinput data
contextGraphbackContextcontext object passed from graphql or rest layer

Returns: Promise‹Type›


delete

delete(data: Type, context: GraphbackContext): Promise‹Type›

Inherited from DataSyncProvider.delete

Defined in packages/graphback-core/types/runtime/GraphbackDataProvider.d.ts:39

Implementation for object deletes

Parameters:

NameTypeDescription
dataTypedata used for checking consistency
contextGraphbackContextcontext object passed from graphql or rest layer

Returns: Promise‹Type›


findBy

findBy(filter: QueryFilter‹Type›, context: GraphbackContext, page?: GraphbackPage, orderBy?: GraphbackOrderBy): Promise‹Type[]›

Inherited from DataSyncProvider.findBy

Defined in packages/graphback-core/types/runtime/GraphbackDataProvider.d.ts:55

Implementation for reading objects with filtering capabilities

Parameters:

NameTypeDescription
filterQueryFilter‹Type›filter by specific type
contextGraphbackContextcontext object passed from graphql or rest layer
page?GraphbackPagepaging context
orderBy?GraphbackOrderBygives the ability to order the results based on a field in ascending or descending order

Returns: Promise‹Type[]›


findOne

findOne(args: Partial‹Type›, context: GraphbackContext): Promise‹Type›

Inherited from DataSyncProvider.findOne

Defined in packages/graphback-core/types/runtime/GraphbackDataProvider.d.ts:46

Implementation for finding a single unique object

Parameters:

NameTypeDescription
argsPartial‹Type›filter by unique attriburtes
contextGraphbackContextcontext object passed from graphql or rest layer

Returns: Promise‹Type›


sync

sync(lastSync: string, context: GraphbackContext, filter?: any): Promise‹Type[]›

Defined in packages/graphback-datasync/src/providers/DataSyncProvider.ts:5

Parameters:

NameType
lastSyncstring
contextGraphbackContext
filter?any

Returns: Promise‹Type[]›


update

update(data: Type, context: GraphbackContext): Promise‹Type›

Inherited from DataSyncProvider.update

Defined in packages/graphback-core/types/runtime/GraphbackDataProvider.d.ts:31

Implementation for object updates

Parameters:

NameTypeDescription
dataTypeinput data
contextGraphbackContextcontext object passed from graphql or rest layer

Returns: Promise‹Type›