Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flag indicating this Operation uses @defer #5668

Open
rohandhruva opened this issue Feb 29, 2024 · 0 comments
Open

Add a flag indicating this Operation uses @defer #5668

rohandhruva opened this issue Feb 29, 2024 · 0 comments

Comments

@rohandhruva
Copy link
Contributor

rohandhruva commented Feb 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant