An open API service indexing awesome lists of open source software.

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

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());
}
}

```