Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

graphql-ruby-persisted_queries

> 后端框架
Open source

Persisted queries for graphql-ruby

178 stars0 likes3 views
WebsiteGitHub

About

Persisted queries for graphql-ruby

GraphQL::PersistedQueries

GraphQL::PersistedQueries is the implementation of persisted queries for graphql-ruby. With this plugin your backend will cache all the queries, while frontend will send the full query only when it's not found at the backend storage.

  • Heavy query parameter will be omitted in most of 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

Used in production by:

  • Yammer by Microsoft
  • Toptal
  • Want to be here? Let me know

Professional Support

Need help with your GraphQL API architecture, schema design, or performance? I'm available for consulting — get in touch.

Getting started

First of all, install and configure apollo's persisted queries on the front–end side:

javascript
import { HttpLink, InMemoryCache, ApolloClient } from "@apollo/client";
import { createPersistedQueryLink } from "@apollo/client/link/persisted-queries";
import { sha256 } from 'crypto-hash';

const httpLink = new HttpLink({ uri: "/graphql" });
const persistedQueriesLink = createPersistedQueryLink({ sha256 });
const client = new ApolloClient({
  cache: new InMemoryCache(),
  link: persistedQueriesLink.concat(httpLink);
});

Add the gem to your Gemfile gem 'graphql-persisted_queries' and add the plugin to your schema class:

ruby
class GraphqlSchema   Read more about the gem internals: [Persisted queries in GraphQL:
Slim down Apollo requests to your Ruby application](https://evilmartians.com/chronicles/persisted-queries-in-graphql-slim-down-apollo-requests-to-your-ruby-application)

## Credits

Initially sponsored by [Evil Martians](http://evilmartians.com).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/DmitryTsepelev/graphql-ruby-persisted_queries.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rubyapollographqlruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架