apollo-feature-requests icon indicating copy to clipboard operation
apollo-feature-requests copied to clipboard

Add experimental support for @defer, @stream, and @live

Open Akryum opened this issue 7 years ago β€’ 23 comments

Migrated from: apollographql/apollo-client#1152

Akryum avatar Jul 27 '18 17:07 Akryum

Alpha support for @defer is now available on Apollo Server/Client! I'm linking the WIP spec here as a reference for authors of other GraphQL servers.

clarencenpy avatar Jul 27 '18 18:07 clarencenpy

Whats about @stream? ☺️

ManAnRuck avatar Dec 10 '18 13:12 ManAnRuck

@ReggaePanda having a look at the implementation I would say that how @defer is used in this alpha version also covers @stream. So you could basically use @defer in lists is if it would be @stream.

@clarencenpy I would be interested in the plans on this alpha version of implementation and when it would find its way to the master branch.

lxwbr avatar Jan 02 '19 21:01 lxwbr

Any update on this?

adamyi avatar Aug 24 '19 01:08 adamyi

seems like this feature is "deferred" to after Apollo Client 3 is released

there's any work on this for the current Apollo client/server ?

sebas5384 avatar Oct 29 '19 15:10 sebas5384

has there ever been a solution for using @live in apollo?

boredland avatar Apr 30 '20 09:04 boredland

What is the status of @defer and @stream support in Apollo Client and Server now that the spec is stage 2?

Akryum avatar Jan 15 '21 17:01 Akryum

@Akryum Looks like it's planned for apollo client v3.5: https://github.com/apollographql/apollo-client/blob/main/ROADMAP.md#35 Also, a general tip: please make sure to wrap @defer and @stream in backticks like this: `@defer` `@stream`. Otherwise you end up unintentionally tagging github users.

dylanwulf avatar Jan 15 '21 18:01 dylanwulf

πŸ‘‹ Hello everyone! Just a quick update on the support of @defer & @stream for the Apollo Client and Apollo Platform... The Client Team is a bit further ahead in development 😎 then some of our other teams, so we are currently aligning our roadmaps to ensure Apollo can offer end to end support of @defer through the platform soon.

@stream support will likely come as a fast follow release for all of our teams, which we are also aligning on internally. The main goal for Apollo is to ensure we have end to end platform support for both of these important GraphQL features. Please let us know if you have questions!

jpvajda avatar May 05 '22 15:05 jpvajda

Is it possible to use "@stream" in apollo client by now? I only got "@defer" working by implementing it like this: https://www.apollographql.com/docs/react/data/defer/

I got it working in the playground through the server though. (but showing null for the underlying objects which seems to be an issue with the playground?) image

I am using React native and package https://www.npmjs.com/package/@apollo/client

sgedda avatar Nov 28 '23 10:11 sgedda

@sgedda If i remember right it's possible by using some the experimental graphql version but it's very much unstable / you have to do some hacky things to make it work. So no, Apollo currently doesn't support @stream right now.

I would recommend using https://formidable.com/open-source/urql/ and https://the-guild.dev/graphql/yoga-server if you really want a proper @stream support. I personally moved my project from apollo to it since i really needed @stream & better performance

Banou26 avatar Nov 28 '23 16:11 Banou26

Hey all πŸ‘‹

As an update here, we are working through how best to support @stream across the entire Apollo platform and figure out how best to roll this functionality out. We will have more to share in the coming days. Glad to see the interest for @stream!

jerelmiller avatar Nov 29 '23 00:11 jerelmiller

@jerelmiller is there an update?

harisvsulaiman avatar Feb 22 '24 15:02 harisvsulaiman

@jerelmiller I’m also interested in an update on this!

tasola avatar Mar 26 '24 15:03 tasola

Nope! I'll communicate an update when we have one πŸ™‚

jerelmiller avatar Mar 26 '24 15:03 jerelmiller

is there a graphql client that supports streaming?

Streaming is useful e.g. for LLM responses, since they are very slow

macrozone avatar Apr 23 '24 13:04 macrozone

@macrozone as per https://github.com/apollographql/apollo-feature-requests/issues/3#issuecomment-1830238231 You can currently use graphql-yoga as graphql server with urql as client, both supports @defer and @stream https://formidable.com/open-source/urql/ https://the-guild.dev/graphql/yoga-server

Banou26 avatar Apr 24 '24 23:04 Banou26

@macrozone as per #3 (comment) You can currently use graphql-yoga as graphql server with urql as client, both supports @defer and @stream https://formidable.com/open-source/urql/ https://the-guild.dev/graphql/yoga-server

yeah, I noticed that about graphql yoga, very cool!

Was not aware that urql supports @defer though, did

macrozone avatar Apr 25 '24 08:04 macrozone

Hey @macrozone πŸ‘‹

If you're looking for @defer only, Apollo Client currently supports this: https://www.apollographql.com/docs/react/data/directives#defer

We don't have support for @stream at the moment. @stream is still a bit of a moving target within the specification itself and the final output is still being hashed out. Feel free to use whatever suits you, just wanted you to be aware that @defer is currently supported πŸ™‚.

jerelmiller avatar Apr 25 '24 17:04 jerelmiller