Skip to content

Commit 6877010

Browse files
committed
B2B-2204: Implement Toggle For Enabling/Disabling Session Support for GraphQL
1 parent 3854187 commit 6877010

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

app/code/Magento/GraphQl/Model/Config/DisableSession.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\Framework\App\Config\ScopeConfigInterface;
1111

1212
/**
13-
* Config for catalog media
13+
* Session disable in graphql configuration model.
1414
*/
1515
class DisableSession
1616
{

app/code/Magento/GraphQl/Plugin/DisableSession.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ public function __construct(
4343
/**
4444
* Prevents session starting while in graphql area and session is disabled in config.
4545
* Returns true if session is allowed to start and false to avoid starting the session.
46+
*
4647
* @see \Magento\Framework\Session\SessionStartChecker::check
4748
*
4849
* @param SessionStartChecker $subject
4950
* @param bool $result
5051
* @return bool
5152
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
53+
* @SuppressWarnings(PHPMD.EmptyCatchBlock)
5254
*/
5355
public function afterCheck(SessionStartChecker $subject, bool $result): bool
5456
{
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
9+
<default>
10+
<graphql>
11+
<session>
12+
<disable>0</disable>
13+
</session>
14+
</graphql>
15+
</default>
16+
</config>

0 commit comments

Comments
 (0)