You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/graphql/schema/live-search/queries/product-search.md
+6-27Lines changed: 6 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -384,42 +384,21 @@ filter:[
384
384
]
385
385
```
386
386
387
-
##### Error handling for categoryPath and categoryIds
387
+
##### Error handling for categories, categoryPath, and categoryIds
388
388
389
-
When sorting by category `position` with an empty or invalid `categoryPath` or `categoryIDs`, the Search service gracefully handles the request to prevent `FAILED_PRECONDITION` errors. This scenario commonly occurs when attempting to sort by position at the root category level, where category paths are not standardized across store views.
389
+
When sorting by category `position` with an empty or invalid `categories`, `categoryPath`, or `categoryIDs`, the Search service gracefully handles the request to prevent `FAILED_PRECONDITION` errors. This scenario commonly occurs when attempting to sort by position at the root category level, where category paths are not standardized across store views.
390
390
391
-
**Behavior when an empty or invalid `categoryPath` is detected with position sorting:**
391
+
**Behavior when an empty or invalid `categories`, `categoryPath`, or `categoryIDs` is detected with position sorting:**
392
392
393
393
- Category position sort is ignored
394
394
- The system falls back to relevance-based sorting
395
395
- Products are returned successfully
396
-
- A structured GraphQL warning is included in the response
397
-
398
-
**Warning message:**
399
-
400
-
The following warning is returned in the `errors` array alongside the product data:
401
-
402
-
```json
403
-
{
404
-
"errors": [
405
-
{
406
-
"message": "Sort ignored due to empty or invalid categoryPath or categoryIds. Default sorting by relevance applied.",
407
-
"locations": [],
408
-
"extensions": {
409
-
"severity": "WARNING",
410
-
"code": "EMPTY_CATEGORY_PATH_OR_CATEGORY_IDS",
411
-
"classification": "DataFetchingException"
412
-
}
413
-
}
414
-
]
415
-
}
416
-
```
417
396
418
397
<InlineAlertvariant="info"slots="text"/>
419
398
420
-
Despite the warning, the query executes successfully and returns product data in the `data` object, sorted by relevance instead of position.
399
+
Despite the empty or invalid `categories`, `categoryPath`, or `categoryIDs`, the query executes successfully and returns product data in the `data` object, sorted by relevance instead of position.
421
400
422
-
**Example query that triggers the warning:**
401
+
**Example query:**
423
402
424
403
```graphql
425
404
{
@@ -449,7 +428,7 @@ Despite the warning, the query executes successfully and returns product data in
449
428
}
450
429
```
451
430
452
-
In this example, the system returns products sorted by relevance with the warning message included in the response.
431
+
In this example, the system returns products sorted by relevance.
0 commit comments