-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Merge Pull Request magento/graphql-ce#114 from magento/graphql-ce:grqphql-mutations-74 - Merged commits: 1. db3f2c7 2. eb2a5a3
- Loading branch information
Showing
6 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
dev/tests/api-functional/testsuite/Magento/GraphQl/TestModule/GraphQlMutationTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\GraphQl\TestModule; | ||
|
||
use Magento\TestFramework\TestCase\GraphQlAbstract; | ||
|
||
/** | ||
* Make sure that it is possible to use GraphQL mutations in Magento | ||
*/ | ||
class GraphQlMutationTest extends GraphQlAbstract | ||
{ | ||
public function testMutation() | ||
{ | ||
$id = 3; | ||
|
||
$query = <<<MUTATION | ||
mutation { | ||
testItem(id: {$id}) { | ||
item_id, | ||
name, | ||
integer_list | ||
} | ||
} | ||
MUTATION; | ||
|
||
$response = $this->graphQlQuery($query); | ||
$this->assertArrayHasKey('testItem', $response); | ||
$testItem = $response['testItem']; | ||
$this->assertArrayHasKey('integer_list', $testItem); | ||
$this->assertEquals([4, 5, 6], $testItem['integer_list']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters