# GraphQL Ruby Persisted Queries

> A plugin for graphql-ruby to reduce HTTP request sizes by sending a request ID instead of an entire selection set.

- URL: https://evilmartians.com/opensource/graphql-ruby-persisted-queries
- GitHub: https://github.com/DmitryTsepelev/graphql-ruby-persisted_queries
- Authors: Dmitry Tsepelev

---

With this plugin for graphql-ruby, GraphQL on Rails developers can reduce HTTP request sizes by sending a request ID instead of an entire selection set (which might be huge in GraphQL applications).

`GraphQL::PersistedQueries` is an implementation of [persisted queries](https://www.apollographql.com/docs/react/api/link/persisted-queries/) for [graphql-ruby](https://github.com/rmosolgo/graphql-ruby). With this plugin, your backend will cache all the queries, while the frontend will send the full query only when it was not found at the backend storage.

- **Heavy query parameter will be omitted in most cases**: network requests will become less heavy.
- **Clients share cached queries**: it's enough to miss cache only once for each unique query.
- **Works for clients without persisted query support**.

*Read also Evil Martians' article*: https://evilmartians.com/chronicles/persisted-queries-in-graphql-slim-down-apollo-requests-to-your-ruby-application
