https://github.com/zestic/codeception-graphql
A codeception extension for calling graphql endpoints
https://github.com/zestic/codeception-graphql
codeception codeception-module graphql
Last synced: 8 months ago
JSON representation
A codeception extension for calling graphql endpoints
- Host: GitHub
- URL: https://github.com/zestic/codeception-graphql
- Owner: zestic
- License: mit
- Created: 2018-03-25T19:57:11.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-10T14:36:49.000Z (over 2 years ago)
- Last Synced: 2025-04-22T17:16:29.074Z (8 months ago)
- Topics: codeception, codeception-module, graphql
- Language: PHP
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Codeception GraphQL
#### A codeception extension for calling GraphQL endpoints
This requires a running server, you can use [Codeception PhpBuiltInServer](https://github.com/tiger-seo/PhpBuiltinServer)
if needed.
#### Installation
```bash
composer require zestic/codeception-graphql --dev
```
#### To configure
In your acceptance.suite.yml file
```yaml
modules:
enabled:
- GraphQL:
url: 'http://localhost:8080/'
```
#### Testing
To use it in a test
```php
class PingCest
{
public function testPing(AcceptanceTester $I)
{
$query = 'query{ping {response}}';
$I->sendGraphQL($query);
$expected = [
'ping' => [
'response' => 'pong',
],
];
$I->assertEquals($expected, $I->grabResponseData());
}
}
```