Skip to content

Releases: block/elasticgraph

v1.2.0

Choose a tag to compare

@github-actions github-actions released this 13 May 16:17

ElasticGraph v1.2.0 has been released! This release introduces index inheritance (allowing multiple concrete types to share a single datastore index), _typename filtering on abstract types, a new returnable: false field option, JRuby support, and significant performance optimizations.

New Features

Index Inheritance

Concrete types can now inherit index definitions from abstract supertypes (interfaces and unions), enabling multiple types to share a single datastore index:

schema.interface_type "Store" do |t|
  t.field "id", "ID!"
  t.index "stores"  # Shared index
end

schema.object_type "OnlineStore" do |t|
  t.implements "Store"
  # Inherits "stores" index from Store
end

schema.object_type "PhysicalStore" do |t|
  t.implements "Store"
  # Also inherits "stores" index
end

schema.object_type "WarehouseStore" do |t|
  t.implements "Store"
  t.index "warehouse_stores"  # Overrides with its own index
end

Both OnlineStore and PhysicalStore documents live in the same stores index, while WarehouseStore uses its own separate index. __typename is used for query-time type resolution. ElasticGraph automatically:

  • Injects __typename into indexed documents for inherited indexes
  • Stores __typename as a constant_keyword in single-type index mappings to support typename filtering
  • Generates appropriate filter inputs and query adapters for abstract types
  • Validates that concrete types inherit from at most one indexed abstract type

_typename Filtering on Abstract Types

A new _typename filter field is available on all interface and union type filter inputs, allowing clients to filter by concrete subtype:

query {
  distributionChannels(
    filter: {
      _typename: {
        equalToAnyOf: ["OnlineStore"]
      }
    }
  ) {
    nodes { ... }
  }
}

This is the filtering equivalent of the __typename return field. The GraphQL spec reserves the __ prefix for its own use, so the filter input field is named _typename (single underscore) instead. This works for top-level queries, embedded fields, and aggregations.

returnable: false Field Option

Fields can now be excluded from storage and GraphQL responses while remaining available for query operations:

t.field "internal_code", "String", returnable: false

When a field is marked returnable: false, ElasticGraph excludes it from the datastore _source via _source.excludes, providing significant storage savings for fields that are only needed for filtering, sorting, grouping, aggregations, or highlights. The field is also excluded from GraphQL output types since the data is not stored.

JRuby Support

ElasticGraph now officially supports JRuby for the first time. This required removing the ox XML parser dependency, making graphql-c_parser optional, eliminating fork usage, and working around several JRuby bugs. See upgrade notes below regarding graphql-c_parser.

Note: We implemented several workarounds for JRuby bugs in this release (in addition to reporting those bugs upstream to JRuby itself). As those bugs are fixed in JRuby, we plan to aggressively drop those workarounds and update the versions of JRuby we officially support in future releases. If you need us to maintain support for specific versions of JRuby, please get in touch via the #elasticgraph channel on the Block Open Source Discord server.

Automatic X-Opaque-Id Headers

ElasticGraph now automatically includes X-Opaque-Id headers on datastore _msearch requests, propagating useful identifiers (client name, query fingerprint) into Elasticsearch/OpenSearch slow logs, task API, and deprecation logs for improved observability.

Upgrade Notes

graphql-c_parser is now optional

As part of JRuby support, the graphql-c_parser gem is no longer automatically required. On MRI (C Ruby), this gem provides significantly faster GraphQL parsing and is strongly recommended. To continue using it, add the following to your Gemfile:

gem "graphql-c_parser", "~> 1.1", platforms: :ruby

If the gem is not present on MRI, ElasticGraph will print a warning to stderr directing you to add it.

Performance Optimizations

Skip Validation for Registered Query Cache Hits

When using elasticgraph-query_registry, registered queries that hit the cache now skip graphql-ruby's StaticValidation pipeline, since these queries were already validated at CI time. This saves ~165μs for small queries and up to ~163ms for extra-large queries per request.

Avoid Thread Fanout for Single-Item Parallel Maps

parallel_map now skips multi-threading for single-item collections, removing the overhead of unnecessary thread creation where it was never beneficial.

What's Changed

New Features

Performance Optimizations

  • Skip validation for registered query cache hits by @jwils in #1134
  • Avoid thread fanout for single-item parallel maps by @jwils in #1160

Bug Fixes

Other Improvements

Read more

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 23 Jan 01:44

ElasticGraph v1.1.0 has been released! This release includes new gems for data warehouse integration, Ruby 4.0 support, significant performance optimizations, and bug fixes.

New Features

Data Warehouse Integration

Two new gems have been added to support data warehouse integration:

elasticgraph-warehouse: An extension that generates Data Warehouse table configurations from ElasticGraph schemas. This enables seamless integration with data warehouse systems like Apache Hive, AWS Athena, and similar SQL-based analytical platforms by automatically generating DDL and configuration files. After adding it to an ElasticGraph project, run bundle exec rake schema_artifacts:dump and a data_warehouse.yaml file will be generated containing SQL CREATE TABLE statements for each indexed type.

elasticgraph-warehouse_lambda: An AWS Lambda integration for warehouse data export. This gem enables export of indexing operations to S3 as gzipped JSONL files, with features like deterministic S3 keys with versioning, date partitioning, and UUIDs.

Ruby 4.0 Support

ElasticGraph now supports Ruby 4.0 (and uses Bundler 4.0).

JSON Schema Improvements

  • Generated JSON schemas now include field description fields, useful for documentation and code generation tools (#875)
  • JSON schema strictness can now be configured with allow_omitted_fields and allow_extra_fields options (#876)

Query Registry Improvements

  • Added extension_data to QueryDetailsTracker enabling GraphQL extensions to log additional data. The query registry uses this to log query_registration_status (#981)
  • Improved operation name handling by preferring selected_operation_name over operation_name, which is safer when a query has only one operation (#986)

Version Validation for Schema Artifacts

ElasticGraph now validates that the schema artifacts version matches the runtime version, raising an error on mismatch (#874)

Upgrade notes

If you use sourced_from in your schema definition, you must now configure your index with i.has_had_multiple_sources! within the t.index block. This ensures the elasticgraph-graphql query engine correctly filters on multi-source documents while avoiding some additional queries ElasticGraph used to make for this case. Once added, this configuration should be retained even if sourced_from fields are later removed, as it remains true forever that the index has had multiple sources.

What's Changed

New Features

Performance Optimizations

  • Implement grouping_missing_value_placeholder for optimized aggregation subaggregations. Previously, when grouping by multiple fields, ElasticGraph created exponentially many subaggregations to handle missing values. The new approach achieves linear scaling, significantly improving performance for queries that group by many fields. by @mmarston and @myronmarston in #890, #893, #894, #895, #903
  • Omit Elasticsearch API calls on indexer boot by @ayousufi in #857
  • Optimize searches_could_hit_incomplete_docs? to avoid datastore queries by @ayousufi in #911

Bug Fixes

  • Resolve range query filter bugs where filters were being overridden due to deep_merge and Ruby hash merging by @ayousufi in #912
  • Fix site:doctest by @jwils in #918

Other Improvements

Dependency Upgrades

The datastore versions we build against have been upgraded:

  • Elasticsearch: 9.1 -> 9.2.0 (#896, #980)
  • OpenSearch: 3.2.x -> 3.3.0 (#896, #980)

The following Ruby gems have been upgraded:

Read more

v1.0.3.rc1

v1.0.3.rc1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 23 Jan 00:39

What's Changed

  • Release v1.0.2 by @github-actions[bot] in #848
  • build(deps): bump the most-gems group with 6 updates by @dependabot[bot] in #852
  • Use github app for update-gem-version-artifacts workflow by @finn-block in #855
  • build(deps-dev): bump @tailwindcss/typography from 0.5.16 to 0.5.18 in /config/site in the npm group by @dependabot[bot] in #851
  • build(deps): bump the github-actions group with 12 updates by @dependabot[bot] in #861
  • build(deps-dev): bump @tailwindcss/typography from 0.5.18 to 0.5.19 in /config/site in the npm group by @dependabot[bot] in #860
  • build(deps): update mcp[cli] requirement from ~=1.14.0 to ~=1.15.0 in /ai_tools/elasticgraph-mcp-server in the pip group by @dependabot[bot] in #859
  • build(deps-dev): bump tailwindcss from 4.1.13 to 4.1.14 in /config/site in the npm group by @dependabot[bot] in #864
  • Bump rack from 3.2.1 to 3.2.2 by @nicolewoch in #867
  • build(deps): bump the pip group across 1 directory with 2 updates by @dependabot[bot] in #870
  • build(deps): bump bigdecimal from 3.2.3 to 3.3.1 in /config/release in the release-gems group by @dependabot[bot] in #869
  • Improve error messages to include 'bundle exec' prefix for rake commands by @mayurvaishnav in #872
  • Support descriptions in generated JSON schemas by @mayurvaishnav in #875
  • Allow omitted fields extra fields by @ciaran51 in #876
  • Add script/lint and document it in CONTRIBUTING.md. by @myronmarston in #877
  • build(deps-dev): bump tailwindcss from 4.1.14 to 4.1.15 in /config/site in the npm group by @dependabot[bot] in #878
  • build(deps): update mcp[cli] requirement from ~=1.17.0 to ~=1.18.0 in /ai_tools/elasticgraph-mcp-server in the pip group by @dependabot[bot] in #879
  • When loading artifacts check dumped elasticgraph version by @coreyosity in #874
  • chore: work around a certs issue that some contributors have reported. by @myronmarston in #881
  • Refactor: instantiate Results and SchemaArtifactManager from the Factory. by @myronmarston in #883
  • build(deps-dev): bump tailwindcss from 4.1.15 to 4.1.16 in /config/site in the npm group by @dependabot[bot] in #887
  • build(deps): update mcp[cli] requirement from ~=1.18.0 to ~=1.19.0 in /ai_tools/elasticgraph-mcp-server in the pip group by @dependabot[bot] in #886
  • Create new empty gem for the warehouse. by @jwils in #884
  • Add base type extensions for the warehouse. by @jwils in #885
  • Phase 1: Add grouping_missing_value_placeholder runtime metadata by @mmarston in #890
  • Phase 2: Infer grouping_missing_value_placeholder based on mapping_type by @mmarston in #893
  • Phase 3: Wire up grouping_missing_value_placeholder in GraphQL layer by @mmarston in #894
  • build(deps): bump the github-actions group with 6 updates by @dependabot[bot] in #897
  • Make it easy to use claude in this codebase. by @myronmarston in #902
  • build(deps): update mcp[cli] requirement from ~=1.19.0 to ~=1.20.0 in /ai_tools/elasticgraph-mcp-server in the pip group by @dependabot[bot] in #900
  • Check coercion adapter when inferring int placeholder. by @myronmarston in #903
  • build(deps): bump rake from 13.3.0 to 13.3.1 in /config/release in the release-gems group by @dependabot[bot] in #898
  • Phase 4: Use grouping_missing_value_placeholder in aggregation logic by @mmarston in #895
  • Improve script/update_gem_constraints: support pinned versions. by @myronmarston in #905
  • build(deps): bump the most-gems group across 1 directory with 35 updates by @dependabot[bot] in #906
  • Build against Elasticsearch 9.2.0 and OpenSearch 3.3.0. by @myronmarston in #896
  • Omit Elasticsearch API calls on indexer boot by @ayousufi in #857
  • build(deps): bump the most-gems group with 3 updates by @dependabot[bot] in #909
  • build(deps-dev): bump tailwindcss from 4.1.16 to 4.1.17 in /config/site in the npm group by @dependabot[bot] in #908
  • build(deps): bump the pip group in /ai_tools/elasticgraph-mcp-server with 4 updates by @dependabot[bot] in #907
  • Remove 'zachbutler-squareup' from CODEOWNERS by @zachbutler-squareup in #915
  • build(deps): bump the most-gems group with 7 updates by @dependabot[bot] in #914
  • Add union type support to the warehouse table by @jwils in #916
  • Optimize searches_could_hit_incomplete_docs? to avoid datastore queries by @ayousufi in #911
  • Fix site:doctest by @jwils in #918
  • Upgrade GraphQL gem from 2.5.11 to 2.5.14. by @myronmarston in #919
  • Make it easier for extensions to add schema artifacts. by @myronmarston in #920
  • build(deps-dev): bump standard from 1.51.1 to 1.52.0 by @dependabot[bot] in #924
  • build(deps): bump the most-gems group with 12 updates by @dependabot[bot] in #923
  • build(deps): bump the pip group in /ai_tools/elasticgraph-mcp-server with 2 updates by @dependabot[bot] in #922
  • Remove an old commented-out line of code. by @myronmarston in #921
  • Refactor SchemaArtifactManager to be friendlier to extension. by @myronmarston in #927
  • Drop work around for OpenSearch < 2.13. by @myronmarston in #926
  • Resolve range query filter bugs by @ayousufi in #912
  • Fix grammar: "x when for y" doesn't read correctly. by @myronmarston in #928
  • build(deps): bump yard from 0.9.37 to 0.9.38 in /config/release in the release-gems group by @dependabot[bot] in #929
  • build(deps): update mcp[cli] requirement from ~=1.22.0 to ~=1.23.2 in /ai_tools/elasticgraph-mcp-server in the pip group by @dependabot[bot] in #930
  • Pin aws-sdk-cloudwatch to 1.125.0 to fix CI test failures. by @myronmarston in #939
  • build(deps): bump graphql from 2.5.14 to 2.5.16 by @dependabot[bot] in #936
  • build(deps): bump json_schemer from 2.4.0 to 2.5.0 by @dependabot[bot] in #935
  • build(deps-dev): bump tailwindcss from 4.1.17 to 4.1.18 in /config/site in the npm group by @dependabot[bot] in #934
  • build(deps): update mcp[cli] requirement from ~=1.23.2 to ~=1.24.0 in /ai_tools/elasticgraph-mcp-server in the pip group by @dependabot[bot] in #937
  • build(deps): bump rack from 3.2.2 to 3.2.4 by @dependabot[bot] in #933
  • build(deps): bump json_schemer from 2.4.0 to 2.5.0 in /config/release in the release-gems group by @dependabot[bot] in #932
  • Upgrade YARD to 0.9.38. by @myronmarston in #941
  • build(deps): bump aws-sdk-s3 from 1.205.0 to 1.208.0 by @dependabot[bot] in #943
  • Use name_in_index for warehouse column type generation. by @jwils in #945
  • Add WarehouseTable model and warehouse_table type method. by @jwils in #946
  • Normalizes DateTime values to consistent 3-digit millisecond precision by @jwils in #944
  • Instantiate Indexing::Index from the schema def factory. by @myronmarston in #953
  • build(deps): bump bigdecimal from 3.3.1 to 4.0.1 in /config/release in the release-gems group by @dependabot[bot] in #950
  • build(deps): bump the most-gems group across 1 directory with 25 updates by @dependabot[bot] in #952
  • build(deps): update mcp[cli] requirement from ~=1.24.0 to ~=1.25.0 in /ai_tools/elasticgraph-mcp-server in the pip group by @Depe...
Read more

v1.0.2

Choose a tag to compare

@github-actions github-actions released this 19 Sep 17:33

New Features

Documentation Changes

Internal Changes

Dependency Changes

  • build(deps-dev): bump tailwindcss from 4.1.11 to 4.1.12 in /config/site in the npm group by @dependabot[bot] in #801
  • build(deps): update mcp[cli] requirement from ~=1.12.3 to ~=1.13.0 in /ai_tools/elasticgraph-mcp-server in the pip group by @dependabot[bot] in #802
  • Upgrade codespell to 2.4.1 on CI. by @myronmarston in #806
  • build(deps): bump the most-gems group with 12 updates by @dependabot[bot] in #822
  • build(deps): bump aws-sdk-sqs from 1.100.0 to 1.101.0 in the most-gems group by @dependabot[bot] in #823
  • build(deps): bump the most-gems group with 7 updates by @dependabot[bot] in #829
  • build(deps): bump the most-gems group with 12 updates by @dependabot[bot] in #830
  • build(deps): bump rack from 3.2.0 to 3.2.1 by @dependabot[bot] in #837
  • build(deps): bump elasticsearch from 9.1.1 to 9.1.2 by @dependabot[bot] in #836
  • build(deps-dev): bump rbs from 3.9.4 to 3.9.5 by @dependabot[bot] in #834
  • build(deps): bump the most-gems group with 11 updates by @dependabot[bot] in #835
  • build(deps): update pytest-cov requirement from ~=6.2.1 to ~=6.3.0 in /ai_tools/elasticgraph-mcp-server in the pip group by @dependabot[bot] in #833
  • build(deps-dev): bump tailwindcss from 4.1.12 to 4.1.13 in /config/site in the npm group by @dependabot[bot] in #832
  • build(deps): bump bigdecimal from 3.2.2 to 3.2.3 in /config/release in the release-gems group by @dependabot[bot] in #831
  • build(deps): bump the most-gems group across 1 directory with 10 updates by @dependabot[bot] in #838
  • Update gem artifacts. by @myronmarston in #839
  • Lock graphql gem to 2.5.11 to resolve elasticgraph-apollo test failure introduced in 2.5.12 by @bsorbo in #842
  • build(deps): bump the release-gems group in /config/release with 2 updates by @dependabot[bot] in #846
  • build(deps): bump the pip group in /ai_tools/elasticgraph-mcp-server with 4 updates by @dependabot[bot] in #847
  • build(deps): bump the most-gems group with 10 updates by @dependabot[bot] in #843
  • build(deps-dev): bump standard from 1.50.0 to 1.51.1 by @dependabot[bot] in #844

New Contributors

Full Changelog: v1.0.1...v1.0.2

v1.0.1

Choose a tag to compare

@github-actions github-actions released this 18 Aug 22:32

ElasticGraph v1.0.1 has been released! This release includes an improved configuration system and a bug fixes.

New Features

New JSON Schemas for Configuration

We've added JSON schema validation to the configuration system. This provides improved defaulting and validation of YAML settings files and is the basis for several new documentation resources:

Upgrade notes

The elasticgraph-json_schema gem has been merged into the elasticgraph-support gem. If you've been listing elasticgraph-json_schema in your Gemfile, you'll need to remove it.

What's Changed

New Features

Bug Fixes

  • fix: Resolved an issue for numeric derived fields that contained values both within Integer and Long ranges by @ayousufi in #795

Other Improvements

New Contributors


Full Changelog: v1.0.0...v1.0.1

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 04 Aug 22:59

ElasticGraph v1.0.0 has been released! This marks a significant milestone in the maturity of ElasticGraph.

This release includes a number of new features and the removal of several long-deprecated features.

New Features

Substring Filtering

ElasticGraph 1.0.0 offers a couple new filtering predicates for string fields.

The contains predicate provides substring filtering:

query AverageSongLengthForYouOrEye {
  artistAggregations {
    nodes {
      subAggregations {
        albums {
          nodes {
            subAggregations {
              tracks(filter: {
                name: {
                  contains: {
                    anySubstringOf: ["you", "eye"]
                    ignoreCase: true
                  }
                }
              }) {
                nodes {
                  groupedBy {
                    name
                  }

                  aggregatedValues {
                    lengthInSeconds {
                      approximateAvg
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

The startsWith predicate provides prefix filtering:

query ArtistsPrefixedWithThe {
  artists(filter: {
    name: {
      startsWith: {
        anyPrefixOf: ["The "]
      }
    }
  }) {
    edges {
      node {
        name
      }
    }
  }
}

Search Highlighting

When searching through textual data it can be very useful to know where matches occurred in the returned documents. For example, to power a "global search" box that lets users search across all string/text fields, you could use a query like this:

query GlobalSearch(
  $query: String = "Rock" # an example search term; replace with whatever you want
) {
  artists(filter: {
    anyOf: [
      {albums: {anySatisfy: {name: {contains: {anySubstringOf: [$query]}}}}}
      {albums: {anySatisfy: {tracks: {anySatisfy: {name: {contains: {anySubstringOf: [$query]}}}}}}}
      {bio: {homeCountry: {equalToAnyOf: [$query]}}}
      {bio: {description: {matchesQuery: {query: $query}}}}
      {name: {contains: {anySubstringOf: [$query]}}}
      {tours: {anySatisfy: {name: {contains: {anySubstringOf: [$query]}}}}}
    ]
  }) {
    edges {
      node {
        name
      }

      highlights {
        albums {
          name
          tracks {
            name
          }
        }

        bio {
          homeCountry
          description
        }

        name

        tours {
          name
        }
      }
    }
  }
}

ElasticGraph also offers allHighlights as an alternative to highlights which allows the query to be simplified a bit:

query GlobalSearchV2(
  $query: String = "Rock" # an example search term; replace with whatever you want
) {
  artists(filter: {
    anyOf: [
      {albums: {anySatisfy: {name: {contains: {anySubstringOf: [$query]}}}}}
      {albums: {anySatisfy: {tracks: {anySatisfy: {name: {contains: {anySubstringOf: [$query]}}}}}}}
      {bio: {homeCountry: {equalToAnyOf: [$query]}}}
      {bio: {description: {matchesQuery: {query: $query}}}}
      {name: {contains: {anySubstringOf: [$query]}}}
      {tours: {anySatisfy: {name: {contains: {anySubstringOf: [$query]}}}}}
    ]
  }) {
    edges {
      node {
        name
      }

      allHighlights {
        path
        snippets
      }
    }
  }
}

Rather than providing the nested structure with named fields provided by highlights, this provides the highlights as a flat
list of SearchHighlight objects, each of which has a path indicating the matching field.

Bundled GraphiQL UI

Before ElasticGraph 1.0.0, ElasticGraph provided a version of GraphiQL that dependened on a CDN (https://esm.sh/) to work. This generally worked fine, but it relied on an active internet connection to work, and ElasticGraph's GraphiQL UI would stop working if the CDN had some downtime.

ElasticGraph 1.0.0 now bundles all GraphiQL assets in a new elasticgraph-graphiql gem. As part of this, we've upgraded GraphiQL from 4.0.0 to 5.2.0.

Support for Elasticsearch 9.1 and OpenSearch 3.0/3.1

ElasticGraph 1.0.0 supports these recently released versions of Elasticsearch and OpenSearch.

Upgrade notes

This release drops support for some legacy features which provided backwards compatibility for old ElasticGraph projects. The upgrade should be quite easy for most existing projects. Here's a detailed checklist.

Verify Ruby Compatibility

This release drops support for Ruby 3.2 and 3.3, requiring Ruby 3.4, which has been supported since ElasticGraph v0.19.1.0. Confirm you're using Ruby 3.4.x on CI and in production before proceeding.

Verify OpenSearch Compatibility

This release drops support for OpenSearch 2.7 to 2.18, requiring 2.19 or greater. If you're using OpenSearch in production, confirm it's version is 2.19 or greater before proceeding.

Remove nested_relationship_resolver_mode from GraphQL configuration

This option was added in ElasticGraph 0.19.2.0 when we were first rolling out the nested relationship performance optimization, so that existing projects could carefully roll that out if desired. Verify that nested_relationship_resolver_mode has been removed from your project's settings YAML files.

Verify Index Compatibility

ElasticGraph v0.9 featured a large change to how indexing worked. As part of that change, ElasticGraph began using a Painless update script for all indexing. All ElasticGraph projects bootstrapped since that time automatically use the new Painless script, but projects that started before that time may still use the old approach. Unfortunately, an index that has been written to using the old approach cannot safely be written to using the Painless update script. A backwards-compatibility mode has been kept around in ElasticGraph since that time, but ElasticGraph 1.0.0 removes it.

If your project predates ElasticGraph v0.9, you'll need to confirm your indices are ready for ElasticGraph 1.0.0 before proceeding:

  • Verify that use_updates_for_indexing: false is not configured in any of your settings YAML files.
    • If use_updates_for_indexing: true is configured, you'll need to remove that configuration. Indexing always uses updates, and no configuration is supported to control it.
  • Verify that all indexed documents have a __versions field. To check, use the dev tools console in Elasticsearch Kibana or OpenSearch dashboards and run one of the following queries:

For OpenSearch:

POST /*,-excluded_index1,-excluded_index2/_search
{
  "derived": {
    "has_versions": {
      "type": "boolean",
      "script": {
        "source": """
          def s = params._source;
          if (s == null) { emit(false); }
          else { emit(s.containsKey("__versions")); }
        """
      }
    }
  },
  "query": {
    "term": { "has_versions": false }
  },
  "_source": true,
  "size": 10
}

For Elasticsearch:

POST /*,-excluded_index1,-excluded_index2/_search
{
  "runtime_mappings": {
    "has_versions": {
      "type": "boolean",
      "script": {
        "source": """
          def s = params._source;
          if (s == null) { emit(false); }
          else { emit(s.containsKey("__versions")); }
        """
      }
    }
  },
  "query": {
    "term": { "has_versions": false }
  },
  "_source": true,
  "size": 10
}

Note

You'll probably have to customize the query above to exclude specific indices that do not have __versions (and should not have __versions) by replacing -excluded_index1,-excluded_index2. In general, any index that is not written to by ElasticGraph should be excluded. These may have names like .kibana_*, .plugins-*, .security* or .opendistro*. In addition, any ElasticGraph derived index (populated using the derive_indexed_type_fields schema definition API) wil not have __versions and should be excluded.

If the query returns no results (after you've excluded the appropriate indices), then you can safely proceed. If results are returned on any non-derived ElasticGraph indices, you're not ready to upgrade to 1.0.0. You'll first need to run a backfill into a fresh index using ElasticGraph 0.19.x with use_updates_for_indexing: true (or with that option omitted to use the default of true). Reach out in the #elasticgraph channel on the Block Open Source Discord server if you need help.

Remove legacy_grouping_schema: true

ElasticGraph 0.17.1.0 introduced an improved Date/Time grouping API. The GraphQL schema for it, while strictly better, was a breaking change for existing GraphQL clients. A backwards-compatibility mode was provided to allow existing ElasticGraph projects to easily upgrade:

t.field "startedAt", "DateTime", legacy_grouping_schema: true

The legacy_grouping_schema option has been removed from ElasticGraph v1.0.0, and if your schema definition uses it, you'll have to go through a multi-step migration process before you can upgrade.

  1. Introduce an aliased field. The field should use an alternate name (e.g. with a Legacy suffix), be graphql_only, and specify a name_in_index of the original field so that it's backed by the existing field in the index:
diff --git a/config/schema/artists.rb b/config/schema/artists.rb
index dbeeef4..b633d7b 100644
---...
Read more

v1.0.0.rc4

v1.0.0.rc4 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 04 Aug 17:45

What's Changed

New Contributors

Full Changelog: v1.0.0.rc3...v1.0.0.rc4

v1.0.0.rc3

v1.0.0.rc3 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 10 Jul 21:41

What's Changed

Full Changelog: v1.0.0.rc2...v1.0.0.rc3

v1.0.0.rc2

v1.0.0.rc2 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 09 Jul 18:09

What's Changed

Full Changelog: v1.0.0.rc1...v1.0.0.rc2

v0.19.3.0

Choose a tag to compare

@github-actions github-actions released this 20 Jun 16:30

ElasticGraph v0.19.3.0 has been released! This release includes a couple of new features, some bug fixes, and a minor breaking change.

New Feature: Field-level Custom Resolver Arguments

We added a custom GraphQL resolver API in ElasticGraph v0.19.2.0. That release allowed the same resolver class to be used with different parameters by registering it multiple times:

require(require_path = "roll_dice_resolver")
schema.register_graphql_resolver :roll_2_dice,
  RollDiceResolver,
  defined_at: require_path,
  number_of_dice: 2

schema.register_graphql_resolver :roll_3_dice,
  RollDiceResolver,
  defined_at: require_path,
  number_of_dice: 3

schema.on_root_query_type do |t|
  t.field "roll2Dice", "Int" do |f|
    f.resolve_with :roll_2_dice
  end

  t.field "roll3Dice", "Int" do |f|
    f.resolve_with :roll_3_dice
  end
end

ElasticGraph v0.19.3.0 allows you to provide these parameters at the field level when configuring a field to use a resolver:

require(require_path = "roll_dice_resolver")
schema.register_graphql_resolver :roll_dice,
  RollDiceResolver,
  defined_at: require_path

schema.on_root_query_type do |t|
  t.field "roll2Dice", "Int" do |f|
    f.resolve_with :roll_dice, number_of_dice: 2
  end

  t.field "roll3Dice", "Int" do |f|
    f.resolve_with :roll_dice, number_of_dice: 3
  end
end

Improved Apollo Federation Support

Apollo Federation provides a powerful way to combine multiple subgraphs into a single supergraph. ElasticGraph has shipped with the elasticgraph-apollo extension for a long time, which makes any ElasticGraph project plug into an Apollo supergraph as a subgraph.

However, ElasticGraph schemas haven't always lined up with Apollo federation idioms. To expose a reference to an Apollo entity, a subgraph needs to expose an entity reference containing a non-resolvable entity with just the @key fields:

type Product @key(fields: "id", resolvable: false) {
  id: ID
}

The ElasticGraph schema would then expose fields like product: Product or products: [Product!]! rather than productId: ID or productIds: [ID!]!. However, if your schema already has a productId field, migrating to the entity reference can be a significant effort, requiring clients to migrate and a backfill.

ElasticGraph v0.19.3.0 includes a new feature to help out in this situation. Here's how to use it:

# Existing field
t.field "productId", "ID"

# New field defined with the new feature
t.apollo_entity_ref_field "product", "Product", id_field_name_in_index: "productId"

This exposes a Product field backed by the productId field.

You can also use this on a collection of IDs:

# Existing field
t.field "productIds", "[ID!]!"

# New field defined with the new feature
t.apollo_entity_ref_field "products", "[Product!]!", id_field_name_in_index: "productIds"

Or, if you want to provide a paginated collection as a relay connection:

# Existing field
t.field "productIds", "[ID!]!"

# New field defined with the new feature
t.apollo_entity_ref_paginated_collection_field "products", "Product", id_field_name_in_index: "productIds"

Upgrade Notes

This release includes a minor breaking change to the custom GraphQL resolver API added in v0.19.2.0. Previously, this was the API to configure a field to use a custom resolver:

schema.on_root_query_type do |t|
  t.field "rollDice", "Int" do |f|
    f.resolver = :roll_dice
  end
end

In ElasticGraph v0.19.3.0, that's changed slightly:

schema.on_root_query_type do |t|
  t.field "rollDice", "Int" do |f|
    f.resolve_with :roll_dice
  end
end

If your project uses custom resolvers (which is not common), you'll need to update to the new API as part of upgrading ElasticGraph.

What's Changed

New Features

Breaking Changes

Bug Fixes

Other Improvements

Full Changelog: v0.19.2.2...v0.19.3.0