diff --git a/packages/composer/amazeelabs/silverback_graphql_persisted/silverback_graphql_persisted.services.yml b/packages/composer/amazeelabs/silverback_graphql_persisted/silverback_graphql_persisted.services.yml new file mode 100644 index 000000000..f146f7374 --- /dev/null +++ b/packages/composer/amazeelabs/silverback_graphql_persisted/silverback_graphql_persisted.services.yml @@ -0,0 +1,5 @@ +services: + fix_graphql_caching_subscriber: + class: Drupal\silverback_graphql_persisted\EventSubscriber\FixGraphQLCachingSubscriber + tags: + - { name: event_subscriber } \ No newline at end of file diff --git a/packages/composer/amazeelabs/silverback_graphql_persisted/src/EventSubscriber/FixGraphQLCachingSubscriber.php b/packages/composer/amazeelabs/silverback_graphql_persisted/src/EventSubscriber/FixGraphQLCachingSubscriber.php new file mode 100644 index 000000000..12f5adfb7 --- /dev/null +++ b/packages/composer/amazeelabs/silverback_graphql_persisted/src/EventSubscriber/FixGraphQLCachingSubscriber.php @@ -0,0 +1,27 @@ +getContext()->addCacheContexts( + ['url.query_args:variables', 'url.query_args:extensions'] + ); + } + + public static function getSubscribedEvents() { + return [ + OperationEvent::GRAPHQL_OPERATION_BEFORE => 'onBeforeOperation', + ]; + } +}