@lde/search-api-graphql
v0.25.2
Published
Engine- and domain-agnostic GraphQL surface for @lde/search: builds an executable GraphQLSchema from a whole SearchSchema at runtime (no codegen) – one root query field per SearchType – served by generic resolvers over any SearchEngine – and serves it as
Readme
@lde/search-api-graphql
The GraphQL surface for the @lde/search core. Both engine- and
domain-agnostic: it builds an executable
graphql-js GraphQLSchema from your whole
SearchSchema at runtime – one root query
field per SearchType, each searchable in its own way.
Installation
npm install @lde/search-api-graphqlimport { searchSchema } from '@lde/search';
import { buildGraphQLSchema } from '@lde/search-api-graphql';
const gqlSchema = buildGraphQLSchema(searchSchema(DATASET, PERSON));
// The API now serves `datasets(…)` and `persons(…)` root fields.
// Hand `gqlSchema` to any graphql-js server; populate the per-request context:
// { engine: SearchEngine, acceptLanguage: string[] }Documentation
See the full documentation.
