apollo-kotlin
apollo-kotlin copied to clipboard
Add a flag indicating this `Operation` uses `@defer`
Use case
For the auto-generated files that correspond to an Operation
, we currently have no way of identifying whether this operation uses @defer
. Would it be possible to add a flag that will tell us?
The reason behind this request is that internally we wrap the apollo client APIs, and our current query()
API is a suspend fun
, which means that it can't support streaming / multiple responses that is required when using @defer
.
With this flag, we can fail-fast when someone tries to use our custom suspend fun query()
with an operation that uses @defer
.
Describe the solution you'd like
Perhaps interface Operation
is a good place to add this new flag?
Maybe the flag could be something generic and not specific to @defer
, for example: val canHaveMultipleResponses
(naming is hard 😅). I'm guessing @stream
will need something like this too.