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

Caching for GraphQL servers #175

Closed
schickling opened this issue Feb 15, 2018 · 8 comments
Closed

Caching for GraphQL servers #175

schickling opened this issue Feb 15, 2018 · 8 comments
Labels
kind/discussion Discussion, question or feedback

Comments

@schickling
Copy link
Contributor

While building GraphQL servers has become very easy, caching in GraphQL servers is still a fairly unexplored topic.

To start a conversation around this topic, I've listed a few ideas that came to mind. Ideally some of these ideas might eventually turn into actual libraries the GraphQL community can use:

Ideas:

  1. Declarative caching system based on SDL directives (field/resolver or type level)
  2. Caching layer built into GraphQL bindings
  3. Caching based on persisted queries

Relevant links:

@schickling schickling added the kind/discussion Discussion, question or feedback label Feb 15, 2018
@Hendrixer
Copy link

RIght now, there's the Apollo Caching system. However, there isn't any open source projects that I know of that implement this. Only Apollo Engine, which is a black box.

Caching on the edge is also important. That is probably beyond the implementation of Yoga, but should be considered when building something out.

@Hendrixer
Copy link

Caching built into the bindings makes more since for me than caching the queries themselves.

  1. Would allow more control over when and how to clear the cache.
  2. Other queries using the same binding could use the same cached resource

@jiv-e
Copy link

jiv-e commented Oct 26, 2018

@stale
Copy link

stale bot commented Dec 25, 2018

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

@stale stale bot added the status/stale label Dec 25, 2018
@zlwu
Copy link

zlwu commented Dec 28, 2018

There is an official apollo server doc on using a Memcached/Redis cache backend. But looks like no further info on how to integrate with yoga...

@stale stale bot removed the status/stale label Dec 28, 2018
@stale
Copy link

stale bot commented Feb 26, 2019

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

@stale stale bot added the status/stale label Feb 26, 2019
@stale
Copy link

stale bot commented Mar 5, 2019

Hey 👋, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of graphql-yoga we'll close it.
Feel free to reopen it at any time if you believe we should futher discuss its content. 🙂

@stale stale bot closed this as completed Mar 5, 2019
@Urigo
Copy link
Collaborator

Urigo commented Mar 29, 2022

Hey, @Urigo from The Guild here!

You might know us from projects such as graphql-code-generator, envelop or graphql-tools.

For a long time we thought that the Javascript ecosystem is still missing a lightweight cross-platform, but still highly customizable GraphQL Server.

In the past the awesome Prisma team took on that great challenge and now we are happy to announce that we are continuing them and just released GraphQL Yoga 2.0 - Build fast, extensible, and batteries-included (Subscriptions, Serverless, File uploads support) GraphQL APIs in Node.js 🚀

As for the issue here, Yoga uses Envelop's plugin system and marketplace of plugins, which includes the response cache plugin, here is a short video explaining it: https://graphql.wtf/episodes/34-response-cache-plugin-with-envelop

We have been working a long time on version 2.0 and have been using it in our clients projects for a few months now and shared a couple of alpha cycles here.
Thank you all for your feedback and suggestions, you made this release possible!

Please try Yoga out again, give us feedback and help us spread the word on the new release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/discussion Discussion, question or feedback
Projects
None yet
Development

No branches or pull requests

5 participants