Class QuerierAbstract

Abstract Querier base class to implement Model Queriers. By extending this abstract base class and providing the extending class to the Linker, e.g., by Targeting it, the priority method of the resulting class will be called whenever the Model requests or persists data and, if this class claims the highest priority, its commit method will be called.

Decorator

Provide

Example

Simple Querier stub:

import { Provider, Target } from '@sgrud/core';
import { type Querier } from '@sgrud/data';
import { type Observable } from 'rxjs';

⁠@Target()
export class ExampleQuerier
extends Provider<typeof Querier>('sgrud.data.Querier') {

public override readonly types: Set<Querier.Type> = new Set<Querier.Type>([
'query'
]);

public override commit(
operation: Querier.Operation,
variables: Querier.Variables
): Observable<unknown> {
throw new Error('Stub!');
}

public override priority(): number {
return 0;
}

}

See

Model

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

[provide]: "sgrud.data.Querier" = 'sgrud.data.Querier'

Magic string by which this class is provided.

types: Set<Querier.Type>

A set containing all types of queries this Querier can handle. May contain any of the 'mutation', 'query' and 'subscription' Types.

Methods

Generated using TypeDoc