百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

graphql-ruby-persisted_queries

> 后端框架
开源

用于 graphql-ruby 的持久化查询

178 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

用于 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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubyapollographqlruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类后端框架
定价开源

> 相关工具

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