diff --git a/elasticgraph-apollo/elasticgraph-apollo.gemspec b/elasticgraph-apollo/elasticgraph-apollo.gemspec index b2ba1ee0..f738e85e 100644 --- a/elasticgraph-apollo/elasticgraph-apollo.gemspec +++ b/elasticgraph-apollo/elasticgraph-apollo.gemspec @@ -13,7 +13,7 @@ ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, catego spec.add_dependency "elasticgraph-graphql", eg_version spec.add_dependency "elasticgraph-support", eg_version - spec.add_dependency "graphql", "~> 2.3.19" + spec.add_dependency "graphql", "~> 2.4.3" spec.add_dependency "apollo-federation", "~> 3.8" # Note: technically, this is not purely a development dependency, but since `eg-schema_def` diff --git a/elasticgraph-graphql/elasticgraph-graphql.gemspec b/elasticgraph-graphql/elasticgraph-graphql.gemspec index a4893548..79ede4d0 100644 --- a/elasticgraph-graphql/elasticgraph-graphql.gemspec +++ b/elasticgraph-graphql/elasticgraph-graphql.gemspec @@ -13,7 +13,7 @@ ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, catego spec.add_dependency "elasticgraph-datastore_core", eg_version spec.add_dependency "elasticgraph-schema_artifacts", eg_version - spec.add_dependency "graphql", "~> 2.3.19" + spec.add_dependency "graphql", "~> 2.4.3" spec.add_development_dependency "elasticgraph-admin", eg_version spec.add_development_dependency "elasticgraph-elasticsearch", eg_version diff --git a/elasticgraph-graphql/lib/elastic_graph/graphql.rb b/elasticgraph-graphql/lib/elastic_graph/graphql.rb index 42605acd..2f40f57c 100644 --- a/elasticgraph-graphql/lib/elastic_graph/graphql.rb +++ b/elasticgraph-graphql/lib/elastic_graph/graphql.rb @@ -142,7 +142,13 @@ def datastore_query_builder def graphql_gem_plugins @graphql_gem_plugins ||= begin require "graphql" - {::GraphQL::Dataloader => {}} + { + # We depend on this to avoid N+1 calls to the datastore. + ::GraphQL::Dataloader => {}, + # This is new in the graphql-ruby 2.4 release, and will be required in the future. + # We pass `preload: true` because the way we handle the schema depends on it being preloaded. + ::GraphQL::Schema::Visibility => {preload: true} + } end end diff --git a/elasticgraph-graphql/sig/graphql_gem.rbs b/elasticgraph-graphql/sig/graphql_gem.rbs index 802b6409..b54adc21 100644 --- a/elasticgraph-graphql/sig/graphql_gem.rbs +++ b/elasticgraph-graphql/sig/graphql_gem.rbs @@ -168,6 +168,9 @@ module GraphQL class Printer def self.print_schema: (Schema, **untyped) -> ::String end + + class Visibility + end end module StaticValidation diff --git a/elasticgraph-query_registry/elasticgraph-query_registry.gemspec b/elasticgraph-query_registry/elasticgraph-query_registry.gemspec index ce987cbd..be74a2aa 100644 --- a/elasticgraph-query_registry/elasticgraph-query_registry.gemspec +++ b/elasticgraph-query_registry/elasticgraph-query_registry.gemspec @@ -14,7 +14,7 @@ ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, catego spec.add_dependency "elasticgraph-graphql", eg_version spec.add_dependency "elasticgraph-support", eg_version - spec.add_dependency "graphql", "~> 2.3.19" + spec.add_dependency "graphql", "~> 2.4.3" spec.add_dependency "rake", "~> 13.2" spec.add_development_dependency "elasticgraph-elasticsearch", eg_version diff --git a/elasticgraph-query_registry/spec/unit/elastic_graph/query_registry/rake_tasks_spec.rb b/elasticgraph-query_registry/spec/unit/elastic_graph/query_registry/rake_tasks_spec.rb index e8f887b2..348166ee 100644 --- a/elasticgraph-query_registry/spec/unit/elastic_graph/query_registry/rake_tasks_spec.rb +++ b/elasticgraph-query_registry/spec/unit/elastic_graph/query_registry/rake_tasks_spec.rb @@ -116,7 +116,7 @@ module QueryRegistry For client `client_bob`: - CountComponents.graphql (2 operations): - CountComponents: 🛑. Got 2 validation errors: - 1) Field 'total_edge_count2' doesn't exist on type 'ComponentConnection' + 1) Field 'total_edge_count2' doesn't exist on type 'ComponentConnection' (Did you mean `total_edge_count`?) path: query CountComponents.components.total_edge_count2 source: query_registry/client_bob/CountComponents.graphql:3:5 code: undefinedField diff --git a/elasticgraph-schema_definition/elasticgraph-schema_definition.gemspec b/elasticgraph-schema_definition/elasticgraph-schema_definition.gemspec index 76fb2045..0128c35b 100644 --- a/elasticgraph-schema_definition/elasticgraph-schema_definition.gemspec +++ b/elasticgraph-schema_definition/elasticgraph-schema_definition.gemspec @@ -16,7 +16,7 @@ ElasticGraphGemspecHelper.define_elasticgraph_gem(gemspec_file: __FILE__, catego spec.add_dependency "elasticgraph-json_schema", eg_version spec.add_dependency "elasticgraph-schema_artifacts", eg_version spec.add_dependency "elasticgraph-support", eg_version - spec.add_dependency "graphql", "~> 2.3.19" + spec.add_dependency "graphql", "~> 2.4.3" spec.add_dependency "rake", "~> 13.2" spec.add_development_dependency "elasticgraph-admin", eg_version