You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an existing issue that is already proposing this?
I have searched the existing issues
Is your feature request related to a problem? Please describe it
I would like to propose the addition of support for the @defer directive in GraphQL within the Nest.js framework.
The absence of support for the @defer directive in Nest.js presents a limitation for developers who are building GraphQL APIs with real-time or large datasets. Currently, Nest.js users are unable to take advantage of the @defer directive, which allows GraphQL servers to send parts of the response as soon as they are available, rather than waiting for the entire query to be resolved. This can result in suboptimal performance and increased latency for applications dealing with complex queries or real-time data updates.
Integrating support for the @defer directive into Nest.js would address this limitation and provide developers with a more efficient way to handle large and complex queries in GraphQL APIs. This enhancement would not only improve the performance and scalability of Nest.js applications but also contribute to a better overall developer experience.
Describe the solution you'd like
I propose adding native support for the @defer directive in the Nest.js GraphQL module. This would involve implementing the necessary functionality to recognize and process @defer directives within GraphQL queries handled by Nest.js servers.
Additionally, it would be beneficial to provide configuration options for fine-tuning the behavior of @defer, such as setting timeouts for deferred fields or specifying the maximum number of concurrent deferred responses.
By integrating support for@defer directly into the Nest.js framework, developers would have a seamless and efficient way to leverage this feature in their GraphQL APIs without relying on external libraries or custom implementations.
What is the motivation / use case for changing the behavior?
What is the motivation / use case for changing the behavior?
The motivation behind adding support for the @defer directive in Nest.js is to enhance the performance and scalability of GraphQL APIs built with the framework.
Use cases for this feature include:
Handling large and complex queries more efficiently by sending partial responses as soon as data becomes available, reducing overall latency for clients.
Supporting real-time data updates by deferring non-critical parts of the query, allowing critical data to be delivered to clients more quickly.
Improving the user experience for applications that rely on GraphQL APIs, especially those with interactive or real-time features, by minimizing wait times for query responses.
Overall, adding support for @defer in Nest.js would align the framework with modern best practices for building high-performance GraphQL APIs and provide developers with a powerful tool for optimizing query execution.
The text was updated successfully, but these errors were encountered:
Disclaimer: Beware that using those directives is still an experimental feature as Apollo Server still does not support the latest spec of this directives. There is a v17.0.0-alpha.3 release of graphql-js which is not supported by Apollo Server as it contains breaking changes in @defer and @stream directives execution
As long as i know, there is no need to do something on NestJS side.
Apollo Server already supports defer directive out of the box, the only issue on NestJS side is lack of documentation.
To make @defer and @stream directives work with ApolloDriver, you need to:
Import GraphQLDeferDirective and GraphQLStreamDirective and apply them in GraphQL module config
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
I would like to propose the addition of support for the
@defer
directive in GraphQL within the Nest.js framework.The absence of support for the
@defer
directive in Nest.js presents a limitation for developers who are building GraphQL APIs with real-time or large datasets. Currently, Nest.js users are unable to take advantage of the@defer
directive, which allows GraphQL servers to send parts of the response as soon as they are available, rather than waiting for the entire query to be resolved. This can result in suboptimal performance and increased latency for applications dealing with complex queries or real-time data updates.Integrating support for the
@defer
directive into Nest.js would address this limitation and provide developers with a more efficient way to handle large and complex queries in GraphQL APIs. This enhancement would not only improve the performance and scalability of Nest.js applications but also contribute to a better overall developer experience.Describe the solution you'd like
I propose adding native support for the
@defer
directive in the Nest.js GraphQL module. This would involve implementing the necessary functionality to recognize and process@defer
directives within GraphQL queries handled by Nest.js servers.Additionally, it would be beneficial to provide configuration options for fine-tuning the behavior of
@defer
, such as setting timeouts for deferred fields or specifying the maximum number of concurrent deferred responses.By integrating support for
@defer
directly into the Nest.js framework, developers would have a seamless and efficient way to leverage this feature in their GraphQL APIs without relying on external libraries or custom implementations.What is the motivation / use case for changing the behavior?
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
The motivation behind adding support for the
@defer
directive in Nest.js is to enhance the performance and scalability of GraphQL APIs built with the framework.Use cases for this feature include:
Handling large and complex queries more efficiently by sending partial responses as soon as data becomes available, reducing overall latency for clients.
Supporting real-time data updates by deferring non-critical parts of the query, allowing critical data to be delivered to clients more quickly.
Improving the user experience for applications that rely on GraphQL APIs, especially those with interactive or real-time features, by minimizing wait times for query responses.
Overall, adding support for
@defer
in Nest.js would align the framework with modern best practices for building high-performance GraphQL APIs and provide developers with a powerful tool for optimizing query execution.The text was updated successfully, but these errors were encountered: