Skip to content

Fix conditional totalCount - #10397

Open
drebouta wants to merge 2 commits into
ChilliCream:mainfrom
drebouta:fix-conditional-total-count
Open

drebouta wants to merge 2 commits into
ChilliCream:mainfrom
drebouta:fix-conditional-total-count

Conversation

@drebouta

Copy link
Copy Markdown
Contributor

Issue: GetConnectionFlags caches on the selection, which lives as long as the compiled
operation. A value derived from the include flags of whichever request ran first. A connection
gated by @skip/@include then keeps those flags, so after one request without totalCount
every later request asking for it fails with HC0018.

Fix: recompute the flags per request when the connection's selection set is conditional;
the unconditional case keeps the cache.

Closes #10396

Pins both directions: a later request that selects totalCount must see
ConnectionFlags.TotalCount, and a later request that omits it must not.
GetConnectionFlags derived the flags with the include flags of whichever
request ran first and cached them on the selection, which lives as long as
the compiled operation. A connection whose selection set is gated by
@skip/@include therefore kept answering with the first request's flags.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

totalCount @include(if: $var) on a connection is frozen by the first execution of the document

1 participant