Strawberry GraphQL @ 0.343.3

Released

This release fixes slow validation and execution for documents that spread the same fragment many times, and makes ListConnection cheaper for last without before .

QueryDepthLimiter and MaxAliasesLimiter now measure each fragment once per document instead of once per spread, and info.selected_fields converts each fragment once and shares the result between its spreads. ListConnection decides whether edges were requested by looking only at the connection’s own selection, following each fragment once. Previously a small document whose fragments spread other fragments several times could take a very long time to validate or resolve. Limits and query results are unchanged; a fragment that is too deep is now reported once per depth it is spread at, instead of once per spread.

QueryDepthLimiter also no longer raises KeyError on a spread of an undefined fragment, so the usual Unknown fragment validation error is returned instead.

ListConnection queried with last and no before now builds edges, cursors and resolve_node calls only for the items on the page. Previously it built them for every item from the start of the list (or from after ), then kept only the last ones.

This release was contributed by @patrick91 in https://github.com/strawberry-graphql/strawberry/pull/4841

Additional contributors: @pre -commit-ci[bot], @ampagent