graphql / express-graphql

Create a GraphQL HTTP server with Express.
MIT License
6.34k stars 538 forks source link

add example GraphQL server and client that use @defer #784

Open gabbigum opened 2 years ago

gabbigum commented 2 years ago

Improvement of examples documentation.

What led to this PR: https://github.com/graphql/graphql-js/discussions/3291

linux-foundation-easycla[bot] commented 2 years ago

CLA Missing ID

saihaj commented 2 years ago

@IvanGoncharov @robrichard can you please review and merge this

acao commented 2 years ago

awesome! we have stream and defer examples in graphiql as well.

it doesn't work yet with netlify, or we need to configure our netlify function to handle multipart better, it seems to send all the chunks at once sync. but if you run this same query with the local server and express-graphql it just works!

https://graphiql-test.netlify.app/?query=query%20%7B%0A%20%20streamable(delay%3A%201000)%20%40stream(initialCount%3A%202)%20%7B%0A%20%20%20%20text%0A%20%20%7D%0A%7D&operationName=Example

acao commented 2 years ago

@gabbigum you'll need to sign the CLA. thanks for this PR!

gabbigum commented 2 years ago

I signed the CLA. Thanks :)

gabbigum commented 2 years ago

awesome! we have stream and defer examples in graphiql as well.

it doesn't work yet with netlify, or we need to configure our netlify function to handle multipart better, it seems to send all the chunks at once sync. but if you run this same query with the local server and express-graphql it just works!

https://graphiql-test.netlify.app/?query=query%20%7B%0A%20%20streamable(delay%3A%201000)%20%40stream(initialCount%3A%202)%20%7B%0A%20%20%20%20text%0A%20%20%7D%0A%7D&operationName=Example

Can you send me examples of @defer with graphiql. It would help me a lot.