@lde/search-api-graphql 0.19.0 → 0.20.1
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.
- package/dist/build-schema.d.ts.map +1 -1
- package/dist/build-schema.js +14 -2
- package/package.json +2 -2
|
@@ -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,EAKL,KAAK,YAAY,EAEjB,KAAK,WAAW,EAChB,KAAK,YAAY,EAElB,MAAM,aAAa,CAAC;AAgBrB,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAGvB,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B;;sDAEkD;IAClD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACjE;AAED;2EAC2E;AAC3E,MAAM,WAAW,iBAAiB;IAChC;yCACqC;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;uBACmB;IACnB,QAAQ,CAAC,aAAa,CAAC,EAAE,CACvB,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,aAAa,KACnB,WAAW,CAAC;CAClB;AAED,MAAM,WAAW,yBAAyB;IACxC;;kEAE8D;IAC9D,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAC7D,+EAA+E;IAC/E,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;IACvC;;gDAE4C;IAC5C,Q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;CAC9B;AAkBD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,OAAO,GAAE,yBAA8B,GACtC,aAAa,CAiff;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,OAAO,GAAE,yBAA8B,GACtC,MAAM,CAER"}
|
package/dist/build-schema.js
CHANGED
|
@@ -152,7 +152,10 @@ export function buildGraphQLSchema(schema, options = {}) {
|
|
|
152
152
|
fields: () => nested === undefined
|
|
153
153
|
? {
|
|
154
154
|
id: { type: new GraphQLNonNull(GraphQLString) },
|
|
155
|
-
|
|
155
|
+
// `label`, the same word the label source declares and a
|
|
156
|
+
// reference facet’s bucket carries: one resolved label, one
|
|
157
|
+
// name for it wherever it surfaces.
|
|
158
|
+
label: labelList((source) => source.label),
|
|
156
159
|
}
|
|
157
160
|
: {
|
|
158
161
|
id: { type: GraphQLString },
|
|
@@ -176,7 +179,13 @@ export function buildGraphQLSchema(schema, options = {}) {
|
|
|
176
179
|
registerReferenceType(field, searchType);
|
|
177
180
|
}
|
|
178
181
|
}
|
|
182
|
+
/** A field's config, plus the declared {@link SearchFieldBase.description}
|
|
183
|
+
* wherever the field surfaces – so one sentence written on the declaration
|
|
184
|
+
* reaches the playground, introspection and an editor alike. */
|
|
179
185
|
function outputFieldConfig(field) {
|
|
186
|
+
return { ...outputFieldType(field), description: field.description };
|
|
187
|
+
}
|
|
188
|
+
function outputFieldType(field) {
|
|
180
189
|
switch (field.kind) {
|
|
181
190
|
case 'text':
|
|
182
191
|
return labelList((source) => source[field.name]);
|
|
@@ -268,7 +277,10 @@ export function buildGraphQLSchema(schema, options = {}) {
|
|
|
268
277
|
[ID_FIELD]: { type: stringFilter },
|
|
269
278
|
};
|
|
270
279
|
for (const field of filterable) {
|
|
271
|
-
fields[field.name] = {
|
|
280
|
+
fields[field.name] = {
|
|
281
|
+
type: whereFieldType(field),
|
|
282
|
+
description: field.description,
|
|
283
|
+
};
|
|
272
284
|
}
|
|
273
285
|
return fields;
|
|
274
286
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lde/search-api-graphql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
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 – and serves it as a framework-agnostic fetch handler with a self-contained playground, SDL endpoint, CORS and depth/cost limits. 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",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@escape.tech/graphql-armor-cost-limit": "^2.4.3",
|
|
29
29
|
"@escape.tech/graphql-armor-max-depth": "^2.4.2",
|
|
30
30
|
"@graphql-yoga/render-graphiql": "^5.21.2",
|
|
31
|
-
"@lde/search": "^0.18.
|
|
31
|
+
"@lde/search": "^0.18.1",
|
|
32
32
|
"dataloader": "^2.2.3",
|
|
33
33
|
"graphql": "^16.9.0",
|
|
34
34
|
"graphql-yoga": "^5.21.2",
|