Schema-driven, scalable, cloud-native, batteries-included GraphQL, backed by Elasticsearch/OpenSearch
ElasticGraph provides schema-driven, scalable, cloud-native, batteries-included GraphQL, backed by Elasticsearch / OpenSearch.
Boot an example ElasticGraph project locally with:
curl -s https://block.github.io/elasticgraph/dc.yml | docker compose -f - up --pull always
Then visit the local GraphiQL UI to try some example queries.
Bootstrap a new ElasticGraph project with:
gem exec elasticgraph new path/to/project
cd path/to/project
bundle exec rake boot_locally
The project website has a full getting started guide.
ElasticGraph is designed as a modular system with a small core and numerous built-in extensions. The codebase is a monorepo containing multiple Ruby gems that work together to provide a rich, comprehensive data platform.
For a detailed exploration of the system architecture, component gems, and their interactions, please see the CODEBASE_OVERVIEW.md.
The project website has extensive user guides and documentation.
We welcome contributions to ElasticGraph!
#elasticgraph channel on the Block Open Source Discord server.ElasticGraph is released under the MIT License.
The GraphiQL interface bundled with elasticgraph-graphiql is derived from the GraphiQL project,
which is also licensed under the MIT License, Copyright (c) GraphQL Contributors.
No good first issue or help wanted issues are currently available.
There are many ways to be an open source contributor, and we're here to help you on your way! You may:
#elasticgraph channel on the Block Open Source Discord serverThis guide is for you.
| Requirement | Tested Version | Installation Instructions |
|---|---|---|
| Ruby | 3.4.x or 4.0.x | ruby-lang.org |
| Java | JDK 11+ | java.com |
| Docker Engine | 27.x | docker.com |
| Docker Compose | 2.29.x | docker.com |
This project is written in Ruby, a dynamic, open source programming language with a focus on simplicity and productivity.
You may verify your ruby installation via the terminal:
$ ruby -v
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [arm64-darwin24]
If you do not have Ruby, we recommend installing it using one of the following:
Ruby dependencies are managed using bundler, which comes installed with Ruby. To install Ruby dependencies, run:
$ bundle install
Once that is done, prefix Ruby commands (ruby, rspec, rake, etc) with bundle exec in order to run them in the context of the project bundle.
This project uses Docker Engine and Docker Compose to run Elasticsearch and OpenSearch locally. We recommend installing Docker Desktop to get both Docker dependencies.
The test suite requires Java 11 or greater to be available on $PATH. You can install a modern JDK using
your package manager (i.e. brew install java).
The project bundle only contains the gems necessary for what runs on CI. For local development, you may want to use some additional gems, such as:
Different engineers have different preferences around what gems to include, so the standard project bundle does not include gems like these. However, support is included to customize the development environment:
Gemfile-custom file listing the additional gems you want to include.
See Gemfile-custom.example for an example.source script/enable_custom_gemfile.This will set the BUNDLE_GEMFILE and BUNDLE_LOCKFILE environment variables in your shell session
so that bundle exec will run in the context of your custom bundle.
To understand how the different parts of the codebase fit together, see the codebase overview.
Using AI tools such as Goose, ChatGPT, Cursor, or Claude to contribute is encouraged. However:
If you use an AI agent, feel free to leverage the growing AI memory bank, and if updates made by your AI agent to that directory seem worth keeping, please include them in your submitted PR!
Primary agent instructions are maintained in AGENTS.md. We keep CLAUDE.md as a compatibility symlink.
The codebase includes a variety of build scripts and executables which are useful for local development:
script/quick_build: Performs an abridged version of the CI build. This is generally the most complete CI build we run locally.
We recommend running it before opening a PR.script/lint: Runs the linter on the codebase, surfacing style and formatting issues.
script/lint --fix to autocorrect most linting issues.script/type_check: Runs a steep type check.script/spellcheck: Spellchecks the codebase using codespell.
script/spellcheck -w to write autocorrections back to source files.script/run_specs: Runs the test suite.script/run_gem_specs [gem_name]: Runs the test suite for one ElasticGraph gem.We use RSpec as our test framework.
Each of the ElasticGraph gems has its own test suite in spec (e.g. elasticgraph-support/spec contains the tests for
elasticgraph-support).
Run the entire suite:
script/run_specs
To test a single gem (e.g., elasticgraph-support):
# From the root:
bundle exec rspec elasticgraph-support/spec
# Alternatively run a gem's specs within the context of that gem's bundle, with code coverage tracked:
script/run_gem_specs elasticgraph-support
# Alternatively, you can run tests within a subdirectory:
cd ela