mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-06 15:59:24 +03:00
Enabled subscriptions in executor
This commit is contained in:
parent
31f40f5e26
commit
26db43e7c4
@ -196,9 +196,18 @@ class Executor
|
||||
);
|
||||
}
|
||||
return $mutationType;
|
||||
case 'subscription':
|
||||
$subscriptionType = $schema->getSubscriptionType();
|
||||
if (!$subscriptionType) {
|
||||
throw new Error(
|
||||
'Schema is not configured for subscriptions',
|
||||
[ $operation ]
|
||||
);
|
||||
}
|
||||
return $subscriptionType;
|
||||
default:
|
||||
throw new Error(
|
||||
'Can only execute queries and mutations',
|
||||
'Can only execute queries, mutations and subscriptions',
|
||||
[$operation]
|
||||
);
|
||||
}
|
||||
|
@ -218,10 +218,8 @@ class EnumTypeTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testAcceptsEnumLiteralsAsInputArgumentsToSubscriptions()
|
||||
{
|
||||
$this->markTestIncomplete('Enable when subscription support is implemented');
|
||||
|
||||
$this->assertEquals(
|
||||
['data' => ['subscribeToEnum' => 'GREEN'], 'errors' => [[]]],
|
||||
['data' => ['subscribeToEnum' => 'GREEN']],
|
||||
GraphQL::execute(
|
||||
$this->schema,
|
||||
'subscription x($color: Color!) { subscribeToEnum(color: $color) }',
|
||||
|
Loading…
x
Reference in New Issue
Block a user