apollo icon indicating copy to clipboard operation
apollo copied to clipboard

@defer support ?

Open alexisgahon opened this issue 7 years ago • 9 comments

Hi,

I am playing with the new directive @defer from apollo-server and I got this error:

{
    "error": "Unexpected number in JSON at position 3"
}

So I would like to know if vue-apollo support this new directive or not ?

alexisgahon avatar Aug 30 '18 12:08 alexisgahon

+1 @alexisgahon The same here. I am running a small demo of the apollo server alpha and the server works perfectlly with queries that do not contain the @defer.

Once a query containing the directive is sent to the server: query { hello helloDeferred @defer{ text } } The response is the same: { "error": "Unexpected number in JSON at position 3" }

bogdanned avatar Sep 25 '18 13:09 bogdanned

Would love to have @defer support too! :-)

ronaldvdv avatar May 07 '19 05:05 ronaldvdv

I'm not sure I have to do anything on vue-apollo side to support this.

Akryum avatar Sep 30 '19 11:09 Akryum

Hi everyone,

Are there any updates regarding defer support for vue-apollo?

When it will be available? or if there are other options available? Thanks in advance

PS: Thank you Akryum for creating vue-apollo

wolfiton avatar Jun 18 '20 14:06 wolfiton

@Akryum 👋 I was curious on your comment above:

I'm not sure I have to do anything on vue-apollo side to support this.

At Apollo we are currently working on implementing @defer support in our Web Client I wanted to check in to see if there was any questions we can answer to help this library leverage the use of @defer once we release it.

https://github.com/apollographql/apollo-client/issues/8184

jpvajda avatar Aug 15 '22 20:08 jpvajda

👋 Just a follow up to my comment above: @defer is now supported in Apollo Web Client. You can see our docs for more information.

jpvajda avatar Sep 17 '22 15:09 jpvajda

Is there anything we need to support this? Are the current observers enough?

Akryum avatar Sep 17 '22 16:09 Akryum

@Akryum 👋 good question! I'll let @alessbell chime in here as she worked on the implementation.

jpvajda avatar Sep 19 '22 16:09 jpvajda

Hi @Akryum 👋 As far as I can tell, there is no action needed on your side.

I spun up a quick demo in our E2E testing codebase running @vue/[email protected] and @apollo/[email protected] (since it was the fastest way for me to query a graph that supports @defer), and you can see that the multipart response is parsed and rendered correctly:

CleanShot 2022-09-19 at 15 09 37

Apollo Client web 3.7 will be out of beta soon, but since there is no action needed here looks like this issue is good to close 👍

alessbell avatar Sep 19 '22 19:09 alessbell