File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
+
2
3
namespace Drupal \silverback_graphql_persisted \EventSubscriber ;
3
4
4
5
use Drupal \graphql \Event \OperationEvent ;
7
8
/**
8
9
* Fix GraphQL caching when internal page cache is active:
9
10
*
10
- * TODO:
11
+ * @todo
11
12
* Can be removed when https://github.com/drupal-graphql/graphql/pull/1317 is
12
13
* resolved.
13
14
*/
14
15
class FixGraphQLCachingSubscriber implements EventSubscriberInterface {
15
16
17
+ /**
18
+ *
19
+ */
16
20
public function onBeforeOperation (OperationEvent $ event ): void {
17
21
$ event ->getContext ()->addCacheContexts (
18
- ['url.query_args:variables ' , 'url.query_args:extensions ' ]
22
+ ['url.query_args:queryId ' , ' url.query_args: variables ' , 'url.query_args:extensions ' ]
19
23
);
20
24
}
21
25
26
+ /**
27
+ *
28
+ */
22
29
public static function getSubscribedEvents () {
23
30
return [
24
31
OperationEvent::GRAPHQL_OPERATION_BEFORE => 'onBeforeOperation ' ,
25
32
];
26
33
}
34
+
27
35
}
You can’t perform that action at this time.
0 commit comments