# GraphQL Fragment Cache

> Improve GraphQL Ruby applications performance with the ability to cache response fragments.

- URL: https://evilmartians.com/opensource/graphql-fragment-cache
- GitHub: https://github.com/DmitryTsepelev/graphql-ruby-fragment_cache
- Authors: Dmitry Tsepelev

---

GraphQL Fragment Cache powers-up GraphQL Ruby applications, adding the ability to cache response fragments, and thus drastically improving performance.

GraphQL::FragmentCache powers up [graphql-ruby](https://graphql-ruby.org) with the ability to cache response _fragments_: you can mark any field as cached and it will never be resolved again (at least, while cache is valid). For instance, the following code caches `title` for each post:

```ruby
class PostType < BaseObject
  field :id, ID, null: false
  field :title, String, null: false, cache_fragment: true
end
```
