@lde/search-api-graphql 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,7 @@ export interface SearchTypeOptions {
30
30
  }
31
31
  export interface BuildGraphQLSchemaOptions {
32
32
  /** Optional fine-tuning per root type, keyed by the {@link SearchType}
33
- * `name` (the logical API name, e.g. `Dataset`) — the key a consumer knows
33
+ * `name` (the logical API name, e.g. `Dataset`) – the key a consumer knows
34
34
  * the type by. A type without an entry gets the defaults. */
35
35
  readonly types?: Readonly<Record<string, SearchTypeOptions>>;
36
36
  /** Output-language ordering; defaults to Accept-Language-first, `und` last. */
@@ -42,7 +42,7 @@ export interface BuildGraphQLSchemaOptions {
42
42
  }
43
43
  /**
44
44
  * Construct an executable GraphQL schema from the whole {@link SearchSchema} at
45
- * runtime — no codegen, no SDL artifact. One root query field per
45
+ * runtime – no codegen, no SDL artifact. One root query field per
46
46
  * {@link SearchType} (e.g. `datasets`, `people`), each searchable in its own
47
47
  * way through its own output/`where`/`orderBy`/facet types, while the shared
48
48
  * types (`LanguageString`, buckets, filter inputs, reference types) are created
@@ -52,7 +52,7 @@ export interface BuildGraphQLSchemaOptions {
52
52
  */
53
53
  export declare function buildGraphQLSchema(schema: SearchSchema, options?: BuildGraphQLSchemaOptions): GraphQLSchema;
54
54
  /**
55
- * The SDL of the built schema. Not a shipped artifact — a consumer uses it for an
55
+ * The SDL of the built schema. Not a shipped artifact – a consumer uses it for an
56
56
  * optional CI snapshot test over its own schema, catching accidental breaking
57
57
  * changes to its frozen contract (including a `buildGraphQLSchema` change in a
58
58
  * future version of this library silently altering it).
@@ -1 +1 @@
1
- {"version":3,"file":"build-schema.d.ts","sourceRoot":"","sources":["../src/build-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,aAAa,EAQd,MAAM,SAAS,CAAC;AACjB,OAAO,EAGL,KAAK,YAAY,EAEjB,KAAK,WAAW,EAChB,KAAK,YAA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  * Construct an executable GraphQL schema from the whole {@link SearchSchema} at
13
- * runtime — no codegen, no SDL artifact. One root query field per
13
+ * runtime – no codegen, no SDL artifact. One root query field per
14
14
  * {@link SearchType} (e.g. `datasets`, `people`), each searchable in its own
15
15
  * way through its own output/`where`/`orderBy`/facet types, while the shared
16
16
  * types (`LanguageString`, buckets, filter inputs, reference types) are created
@@ -86,7 +86,7 @@ export function buildGraphQLSchema(schema, options = {}) {
86
86
  },
87
87
  });
88
88
  // Duplicate root type names cannot occur: SearchSchema is branded, so
89
- // searchSchema() — which rejects duplicates — is the only constructor.
89
+ // searchSchema() – which rejects duplicates – is the only constructor.
90
90
  // One reference type per referenced shape, shared across every root type and
91
91
  // reused by every field (Person and CreativeWork both referencing Agent yield
92
92
  // one Agent type).
@@ -98,7 +98,7 @@ export function buildGraphQLSchema(schema, options = {}) {
98
98
  }
99
99
  const { typeName } = field.ref;
100
100
  if (rootTypeNames.has(typeName)) {
101
- throw new Error(`Reference type name “${typeName}” (field “${field.name}” of “${searchType.name}”) collides with a root type of the same name; rename one — a reference does not resolve to a root type.`);
101
+ throw new Error(`Reference type name “${typeName}” (field “${field.name}” of “${searchType.name}”) collides with a root type of the same name; rename one – a reference does not resolve to a root type.`);
102
102
  }
103
103
  if (!referenceTypes.has(typeName)) {
104
104
  referenceTypes.set(typeName, new GraphQLObjectType({
@@ -171,7 +171,7 @@ export function buildGraphQLSchema(schema, options = {}) {
171
171
  return GraphQLBoolean;
172
172
  }
173
173
  }
174
- /** The root query field for one {@link SearchType}, with its derived types. */
174
+ /** The root query field for one {@link RootType}, with its derived types. */
175
175
  function rootField(searchType, typeOptions) {
176
176
  const typeName = searchType.name;
177
177
  const outputType = new GraphQLObjectType({
@@ -313,7 +313,7 @@ export function buildGraphQLSchema(schema, options = {}) {
313
313
  });
314
314
  }
315
315
  /**
316
- * The SDL of the built schema. Not a shipped artifact — a consumer uses it for an
316
+ * The SDL of the built schema. Not a shipped artifact – a consumer uses it for an
317
317
  * optional CI snapshot test over its own schema, catching accidental breaking
318
318
  * changes to its frozen contract (including a `buildGraphQLSchema` change in a
319
319
  * future version of this library silently altering it).
@@ -322,7 +322,7 @@ export function printGraphQLSchema(schema, options = {}) {
322
322
  return printSchema(buildGraphQLSchema(schema, options));
323
323
  }
324
324
  /** Pure args → {@link SearchQuery} mapping. Rejects out-of-bounds paging
325
- * (`page < 1`, `perPage` outside `1..maxPerPage`) with a clear error — a
325
+ * (`page < 1`, `perPage` outside `1..maxPerPage`) with a clear error – a
326
326
  * negative offset or an unbounded page size must not reach the engine. */
327
327
  function argsToQuery(args, context, searchType, maxPerPage) {
328
328
  const perPage = args.perPage ?? 20;
@@ -1,4 +1,4 @@
1
- import type { FacetBucket, SearchEngine, SearchQuery, SearchType } from '@lde/search';
1
+ import type { FacetBucket, RootType, SearchEngine, SearchQuery } from '@lde/search';
2
2
  /** Resolves one selected facet field to its buckets; see {@link createFacetLoader}. */
3
3
  export type FacetLoader = (field: string) => Promise<readonly FacetBucket[]>;
4
4
  /**
@@ -16,7 +16,7 @@ export type FacetLoader = (field: string) => Promise<readonly FacetBucket[]>;
16
16
  * itself rejecting) degrades every facet. Neither fails the whole GraphQL
17
17
  * query, which would null the non-null result and discard the items.
18
18
  */
19
- export declare function createFacetLoader(engine: SearchEngine, searchType: SearchType, query: SearchQuery, onFacetError?: (field: string, error: unknown) => void): FacetLoader;
19
+ export declare function createFacetLoader(engine: SearchEngine, searchType: RootType, query: SearchQuery, onFacetError?: (field: string, error: unknown) => void): FacetLoader;
20
20
  /**
21
21
  * Group the selected facet fields into the fewest facet-only queries with
22
22
  * unchanged skip-own-filter semantics. Each facet counts with its OWN
@@ -1 +1 @@
1
- {"version":3,"file":"facet-batch.d.ts","sourceRoot":"","sources":["../src/facet-batch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,aAAa,CAAC;AAErB,uFAAuF;AACvF,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAAC;AAE7E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,WAAW,EAClB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,GACrD,WAAW,CAoCb;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,WAAW,EAAE,CAgBf"}
1
+ {"version":3,"file":"facet-batch.d.ts","sourceRoot":"","sources":["../src/facet-batch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,WAAW,EACZ,MAAM,aAAa,CAAC;AAErB,uFAAuF;AACvF,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAAC;AAE7E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,QAAQ,EACpB,KAAK,EAAE,WAAW,EAClB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,GACrD,WAAW,CAoCb;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,WAAW,EAAE,CAgBf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/search-api-graphql",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "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. You supply the schema and per-type typeNames; it names neither your domain nor your engine.",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/ldelements/lde.git",
@@ -25,7 +25,7 @@
25
25
  "!**/*.tsbuildinfo"
26
26
  ],
27
27
  "dependencies": {
28
- "@lde/search": "^0.10.0",
28
+ "@lde/search": "^0.11.0",
29
29
  "dataloader": "^2.2.3",
30
30
  "graphql": "^15.8.0",
31
31
  "tslib": "^2.3.0"