@@ -21,13 +21,6 @@ parameters:
2121 # @default false
2222 development : false
2323
24- # GraphQL schema class to be used:
25- #
26- # By default, this uses the GraphQL schema provided by the module.
27- #
28- # @default \Drupal\graphql\GraphQL\Schema\Schema
29- schema_class : Drupal\graphql\GraphQL\Schema\Schema
30-
3124services :
3225 # Logger channel for graphql related log entries.
3326 logger.channel.graphql :
@@ -80,44 +73,22 @@ services:
8073 graphql.query_processor :
8174 class : Drupal\graphql\GraphQL\Execution\QueryProcessor
8275 arguments :
83- - ' @service_container'
84- - ' @graphql.schema'
85- - ' @graphql.reducer_manager'
86- - ' @current_user'
87- - ' %graphql.config%'
88- graphql.schema :
89- class : Drupal\graphql\GraphQL\Schema\Schema
90- factory : ['@graphql.schema_factory', getSchema]
91- tags :
92- - { name: graphql_extra_cache_metadata }
93- graphql.schema_factory :
94- class : Drupal\graphql\GraphQL\Schema\SchemaFactory
76+ - ' @service_container'
77+ - ' @graphql.reducer_manager'
78+ - ' @graphql.schema_loader'
79+ - ' @current_user'
80+ - ' %graphql.config%'
81+ graphql.schema_loader :
82+ class : Drupal\graphql\GraphQL\Schema\SchemaLoader
9583 arguments :
96- - ' @cache_contexts_manager'
97- - ' @request_stack'
98- - ' @graphql.schema_provider'
99- - ' @cache.graphql_schema'
100- - ' @cache.graphql_schema_metadata'
101- - ' %graphql.config%'
102- tags :
103- - { name: service_collector, tag: graphql_extra_schema_cache_metadata, call: addExtraCacheMetadata }
84+ - ' @cache_contexts_manager'
85+ - ' @request_stack'
86+ - ' @plugin.manager.graphql.schema'
87+ - ' @cache.graphql_schema'
88+ - ' @cache.graphql_schema_metadata'
89+ - ' %graphql.config%'
10490
105- # Global cache metadata to add to every graphql schema.
106- # TODO: This needs to be refactored.
107- graphql.extra_schema_cache_metadata :
108- class : Drupal\Core\Cache\CacheableMetadata
109- calls :
110- - { method: addCacheContexts, arguments: [['languages:language_interface']] }
111- - { method: addCacheTags, arguments: [['graphql_schema']] }
112- tags :
113- - { name: graphql_extra_schema_cache_metadata }
114-
115- # Composite service for gathering schemas.
116- graphql.schema_provider :
117- class : Drupal\graphql\SchemaProvider\SchemaProvider
118- arguments : ['%graphql.config%']
119- tags :
120- - { name: service_collector, tag: graphql_schema_provider, call: addSchemaProvider }
91+ # Query map provider using the composite pattern.
12192 graphql.query_map_provider :
12293 class : Drupal\graphql\QueryMapProvider\QueryMapProvider
12394 tags :
@@ -131,20 +102,24 @@ services:
131102 # Service for graphql request caching.
132103 graphql.cache_subscriber :
133104 class : Drupal\graphql\EventSubscriber\CacheSubscriber
134- arguments : ['@graphql.request_policy', '@graphql.response_policy', '@current_route_match', '@request_stack', '@cache.graphql_response', '@cache.graphql_response_metadata', '@cache_contexts_manager', '%graphql.config%']
105+ arguments :
106+ - ' @graphql.request_policy'
107+ - ' @graphql.response_policy'
108+ - ' @current_route_match'
109+ - ' @request_stack'
110+ - ' @cache.graphql_response'
111+ - ' @cache.graphql_response_metadata'
112+ - ' @cache_contexts_manager'
113+ - ' @graphql.schema_loader'
114+ - ' %graphql.config%'
135115 tags :
136- - { name: service_collector, tag: graphql_extra_cache_metadata, call: addExtraCacheMetadata }
137116 - { name: event_subscriber }
138117
139- # Global cache metadata to add to every graphql request.
140- # TODO: This needs to be refactored.
141- graphql.extra_cache_metadata :
142- class : Drupal\Core\Cache\CacheableMetadata
143- calls :
144- - { method: addCacheContexts, arguments: [['gql', 'user']] }
145- - { method: addCacheTags, arguments: [['graphql_response']] }
118+ graphql.query_routes :
119+ class : Drupal\graphql\Routing\QueryRoutes
120+ arguments : ['@plugin.manager.graphql.schema']
146121 tags :
147- - { name: graphql_extra_cache_metadata }
122+ - { name: 'event_subscriber' }
148123
149124 # Cache request and response policies for graphql requests.
150125 graphql.request_policy :
@@ -181,7 +156,7 @@ services:
181156 # Schema introspection service.
182157 graphql.introspection :
183158 class : Drupal\graphql\GraphQL\Utility\Introspection
184- arguments : ['@service_container', '@ graphql.reducer_manager', '@graphql.schema ']
159+ arguments : ['@graphql.query_processor ']
185160
186161 # Support for subrequests.
187162 graphql.subrequest_subscriber :
@@ -197,20 +172,23 @@ services:
197172 graphql.batched_resolver :
198173 class : Drupal\graphql\GraphQL\Batching\BatchedFieldResolver
199174
200- # Schema provider based on plugin system.
201- graphql.schema_provider.pluggable :
202- class : Drupal\graphql\SchemaProvider\PluggableSchemaProvider
203- arguments :
204- - ' @graphql.pluggable_schema_manager'
205- tags :
206- - { name: graphql_schema_provider }
207-
208175 # Plugin system based schema manager.
209176 graphql.pluggable_schema_manager :
210177 class : Drupal\graphql\Plugin\GraphQL\PluggableSchemaManager
211178 tags :
212179 - { name: service_collector, tag: graphql_plugin_manager, call: addPluginManager }
213180
181+ # Plugin manager for schemas
182+ plugin.manager.graphql.schema :
183+ class : Drupal\graphql\Plugin\GraphQL\SchemaPluginManager
184+ arguments :
185+ - ' Plugin/GraphQL/Schemas'
186+ - ' @container.namespaces'
187+ - ' @module_handler'
188+ - ' \Drupal\graphql\Plugin\GraphQL\Schemas\SchemaPluginBase'
189+ - ' \Drupal\graphql\Annotation\GraphQLSchema'
190+ - ' graphql_schemas'
191+
214192 # Plugin manager implementations for schema types.
215193 plugin.manager.graphql.union_type :
216194 class : Drupal\graphql\Plugin\GraphQL\TypeSystemPluginManager
0 commit comments