16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/elastic_graph/query_interceptor/graphql_extension.rb', line 16
def datastore_query_adapters
@datastore_query_adapters ||= begin
runtime_metadata_configs = runtime_metadata.graphql_extension_modules.map(&:load_extension).filter_map do |ext_mod|
Support::HashUtil.stringify_keys(ext_mod.config) if ext_mod.extension_class == GraphQLExtension
end
query_interceptor_config = Config.from_parsed_yaml(config.extension_settings) || Config.new
interceptors = query_interceptor_config
.with_runtime_metadata_configs(runtime_metadata_configs)
.interceptors
.map { |data| data.klass.new(elasticgraph_graphql: self, config: data.config) }
super + [DatastoreQueryAdapter.new(interceptors)]
end
end
|