Repository navigation
docs(search-api-graphql): state exactly what a fragment costs - #918
Merged
Merged
Conversation
- Correct the claim that a flattened spread never multiplies cost: one at the operation root does - Give the fixed cost of inline fragments and named spreads, and the exact cost of a repeat - Describe flattening in the maxDepth and maxCost JSDoc - Pin each case in tests, so a graphql-armor upgrade that changes scoring fails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #916. Its docs said a flattened fragment spread no longer multiplies the cost of what it contains. That holds for a nested fragment, but not for a spread at the operation root:
{ ...Q } fragment Q on Query { … }still costs its contents 1.5×. A query costing 14.75 inlined costs 25.125 written that way.maxDepthandmaxCost, so they show up in editor hover text.perPagedoesn’t enter the cost (armor scales list cost only forfirst/last), so a page of 100 scores like a page of 1.maxPerPage(default 100) is what bounds result volume. A per-field cost estimator would needgraphql-query-complexityin place of armor’s cost plugin; not worth it whilemaxPerPageholds.