Allow query_cluster: null in datastore config to hide types#1127
Merged
myronmarston merged 3 commits intoblock:mainfrom Apr 16, 2026
Merged
Conversation
bb50ffa to
bd9b1cd
Compare
myronmarston
requested changes
Apr 15, 2026
Collaborator
myronmarston
left a comment
There was a problem hiding this comment.
LGTM apart from one suggested rewording.
The acceptance tests demonstrate that setting `query_cluster: nil` should hide index types from the GraphQL schema. However, loading this configuration from YAML fails validation because the JSON schema only accepts string values. This commit updates the schema definitions to accept null values: - Updated config_schema.yaml to allow ['string', 'null'] - Updated config.rb JSON schema to allow ["string", "null"] - Updated RBS type signatures to allow String? - Added regression test for YAML loading with null value - Updated documentation to explain null behavior The query_cluster field remains required to force explicit configuration choices. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…onfig.rb Co-authored-by: Myron Marston <myron.marston@gmail.com>
356b902 to
abbc1cd
Compare
myronmarston
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow
query_cluster: nullin YAML ConfigurationIssue
The hidden type spec acceptance tests specify that
query_cluster: nilshould hide index types from the GraphQL schema (hidden_types_spec.rb:21), and this works when modifying configs programatically as is done in the test:However, loading this configuration from YAML fails validation:
The JSON schema defines the query_cluster type as the non-nullable
type: "string", even thoughaccessible_from_queries?correctly handles nil at runtime.Solution
Updated JSON schemas to accept
["string", "null"]and RBS signatures to::String?. The field remains required to force explicit configuration choices.Files changed:
config_schema.yaml- Allow['string', 'null']config.rb- Allow["string", "null"]index_definition.rbs- Change to::String?config_spec.rb- Add regression testTesting
In addition to a new regression test for YAML validation with null, I've tested this locally by modifying the schema in
config/settings/development.yaml:components: *main_index_settings electrical_parts: *main_index_settings manufacturers: *main_index_settings - mechanical_parts: *main_index_settings + mechanical_parts: + query_cluster: null + index_into_clusters: ["main"] + ignore_routing_values: [] + custom_timestamp_ranges: [] + setting_overrides: + number_of_shards: 1 + setting_overrides_by_timestamp: {} teams: *main_index_settings widget_currencies: *main_index_settings widgets: *main_index_settingsWithout the fix, starting elasticgraph locally via
bundle exec boot_locallyfails withAfter applying the fix,

boot_locallysucceeds and hides themechanical_partsindex as expected: