docs: describe the search text limits in schema.graphql #59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The
searchargument ofsearchCataloginbackend/src/schema.graphqlnow describes the rules of the search text:BAD_USER_INPUTThe schema is what the clients read, so these rules should be in it, and not only in
docs/API.md. It is a comment change: no field, type or behaviour is changed.Why
From the review of the search (PR #52): the search function in #52 limits the text and returns nothing for text without words, but the schema did not say so. 642 of 836 catalog descriptions have more than 8 words, and 255 have more than 80 characters, so someone who pastes a description gets
BAD_USER_INPUT. The interface should cap its input field.Order
The rules are implemented in #52. This PR only documents them, so merge it together with or after #52. There is no GraphQL server yet, so nothing depends on the order.
Testing
The schema still parses (
graphqlbuildSchema). Only one comment block changed, and the file is not reformatted: Prettier would rewrite every one-line description inschema.graphqlas a block, so it was not run on this file.🤖 Generated with Claude Code