Repository navigation
Generate connection and edge types for StreamPageConnection - #21
Merged
michaelstaib merged 11 commits intoOct 10, 2026
Merged
Conversation
michaelstaib
added this pull request to stack #22
October 4, 2026 19:56
michaelstaib
force-pushed
the
mst/analyzers-streampage-connection
branch
7 times, most recently
from
October 10, 2026 01:36
b850063 to
7c1441f
Compare
Base automatically changed from
mst/pagination-streampage-connection
to
mst/stream-v2
October 10, 2026 02:17
…tion and StreamPageConnection fields
…generated and classic connections
… the four-field default schema snapshot
michaelstaib
force-pushed
the
mst/analyzers-streampage-connection
branch
from
October 10, 2026 02:17
7c1441f to
41cb1e0
Compare
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.
The source generator only knew connections derived from ConnectionBase with list edges, so a resolver returning StreamPageConnection got no connection or edge types. The existing connection pipeline now also recognizes StreamPageConnection for direct, Task and ValueTask returns, derived connections and referenced assemblies. It binds
GetEdgesAsync,GetNodesAsyncandGetTotalCountAsyncas async resolvers that receive the request cancellation token, and keeps PagingArguments, QueryContext and ConnectionFlags generation the same as for PageConnection.Page info follows the unified runtime type from #20: the special case that mapped StreamPageConnection to a separate
StreamPageInfotype is gone. Generated connection types reference the abstractPageInfo, the runtime infers the onePageInfotype from it, and the generator emits no page info type of its own. An executed schema test now holds a classic[UsePaging]field, a generated PageConnection field and a generated StreamPageConnection field in one schema with relative cursors enabled: it shows exactly onePageInfotype with six fields and resolves all six on all three. Without relative cursors the same schema has one four-fieldPageInfo, and selecting a cursor field fails validation. Edges and nodes of a StreamPageConnection are nullable lists, like PageConnection, andGetNodesAsyncis virtual so a derived connection can override it.A second executed schema test enables cost analysis and cache control and shows that the shared
PageInfofields carry neither@costnor@cacheControlon generated and classic connections; the opt-out flag from #20 reaches them through the inferred type, so the generator needs no extra code for it.One thing to watch for in review: the StreamPageConnection part of the executed test runs over an empty stream page, because only a database provider can produce a non-empty one.
Stacked on #20.