Version: 0.16.x

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:

NameTypeDescription
relationFieldstringname of the field that will be used to match ids
idsstring[]array of identifiers that needs to be fetched
filterQueryFilterfilter 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:

NameTypeDescription
filterQueryFilterfilter 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:

NameTypeDescription
dataTypeinput 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:

NameTypeDescription
dataPartial‹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:

NameType
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:

NameTypeDescription
argsPartial‹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:

NameTypeDescription
dataPartial‹Type›input data
selectedFields?string[]-

Returns: Promise‹Type›