Version: next

DataSyncCRUDService

CRUD Service for datasync

Type parameters

T

Hierarchy

  • CRUDService‹T›

    DataSyncCRUDService

Implements

  • GraphbackCRUDService‹T›

Index

Constructors

Properties

Methods

Constructors

constructor

+ new DataSyncCRUDService(modelName: string, db: DataSyncProvider, config: CRUDServiceConfig): DataSyncCRUDService

Overrides void

Defined in packages/graphback-datasync/src/services/DataSyncCRUDService.ts:12

Parameters:

NameType
modelNamestring
dbDataSyncProvider
configCRUDServiceConfig

Returns: DataSyncCRUDService

Properties

Protected db

db: GraphbackDataProvider

Inherited from DataSyncCRUDService.db

Defined in packages/graphback-core/types/runtime/CRUDService.d.ts:24

Methods

batchLoadData

batchLoadData(relationField: string, id: string | number, filter: any, context: GraphbackContext): any

Inherited from DataSyncCRUDService.batchLoadData

Defined in packages/graphback-core/types/runtime/CRUDService.d.ts:37

Parameters:

NameType
relationFieldstring
idstring | number
filterany
contextGraphbackContext

Returns: any


create

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

Inherited from DataSyncCRUDService.create

Defined in packages/graphback-core/types/runtime/CRUDService.d.ts:29

Parameters:

NameType
dataT
contextGraphbackContext

Returns: Promise‹T›


delete

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

Inherited from DataSyncCRUDService.delete

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

Parameters:

NameType
dataT
contextGraphbackContext

Returns: Promise‹T›


findBy

findBy(filter: QueryFilter‹T›, context: GraphbackContext, page?: GraphbackPage, orderBy?: GraphbackOrderBy): Promise‹ResultList‹T››

Inherited from DataSyncCRUDService.findBy

Defined in packages/graphback-core/types/runtime/CRUDService.d.ts:33

Parameters:

NameType
filterQueryFilter‹T›
contextGraphbackContext
page?GraphbackPage
orderBy?GraphbackOrderBy

Returns: Promise‹ResultList‹T››


findOne

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

Inherited from DataSyncCRUDService.findOne

Defined in packages/graphback-core/types/runtime/CRUDService.d.ts:32

Parameters:

NameType
argsPartial‹T›
contextGraphbackContext

Returns: Promise‹T›


subscribeToCreate

subscribeToCreate(filter: any, _context?: GraphbackContext): AsyncIterator‹T› | undefined

Inherited from DataSyncCRUDService.subscribeToCreate

Defined in packages/graphback-core/types/runtime/CRUDService.d.ts:34

Parameters:

NameType
filterany
_context?GraphbackContext

Returns: AsyncIterator‹T› | undefined


subscribeToDelete

subscribeToDelete(filter: any, context: GraphbackContext): AsyncIterator‹T› | undefined

Inherited from DataSyncCRUDService.subscribeToDelete

Defined in packages/graphback-core/types/runtime/CRUDService.d.ts:36

Parameters:

NameType
filterany
contextGraphbackContext

Returns: AsyncIterator‹T› | undefined


subscribeToUpdate

subscribeToUpdate(filter: any, context: GraphbackContext): AsyncIterator‹T› | undefined

Inherited from DataSyncCRUDService.subscribeToUpdate

Defined in packages/graphback-core/types/runtime/CRUDService.d.ts:35

Parameters:

NameType
filterany
contextGraphbackContext

Returns: AsyncIterator‹T› | undefined


Protected subscriptionTopicMapping

subscriptionTopicMapping(triggerType: GraphbackOperationType, objectName: string): string

Inherited from DataSyncCRUDService.subscriptionTopicMapping

Defined in packages/graphback-core/types/runtime/CRUDService.d.ts:41

Provides way to map runtime topics for subscriptions for specific types and object names

Parameters:

NameType
triggerTypeGraphbackOperationType
objectNamestring

Returns: string


sync

sync(lastSync: string, context: GraphbackContext, filter?: any): Promise‹SyncList‹T››

Defined in packages/graphback-datasync/src/services/DataSyncCRUDService.ts:21

sync For delta queries

Parameters:

NameType
lastSyncstring
contextGraphbackContext
filter?any

Returns: Promise‹SyncList‹T››


update

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

Inherited from DataSyncCRUDService.update

Defined in packages/graphback-core/types/runtime/CRUDService.d.ts:30

Parameters:

NameType
dataT
contextGraphbackContext

Returns: Promise‹T›