Class HttpQuerier

The HttpQuerier class implements an Http based Querier, i.e., an extension of the abstract Querier base class, allowing for Model queries to be executed via HTTP. To use this class, provide it to the Linker by either extending it, and decorating the extending class with the Target decorator, or by preemptively supplying an instance of this class to the Linker.

Example

Provide the HttpQuerier to the Linker:

import { Linker } from '@sgrud/core';
import { HttpQuerier } from '@sgrud/data';

new Linker<typeof HttpQuerier>([
[HttpQuerier, new HttpQuerier('https://api.example.com')]
]);

See

Hierarchy (view full)

Constructors

Properties

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

Magic string by which this class is provided.

types: Set<Querier.Type> = ...

A set containing the Querier.Types this Querier can handle. As HTTP connections are short-lived, the HttpQuerier may only handle one-off types, namely 'mutation' and 'query'.

endpoint: string

The HTTP endpoint to commit queries against.

prioritize: number | Map<Model.Type<Model<any>>, number> = 0

The dynamic or static prioritization.

Default Value

0

See

priority

Methods

Generated using TypeDoc