Skip to content

Commit

Permalink
Add operation factory
Browse files Browse the repository at this point in the history
  • Loading branch information
guym4c authored May 12, 2019
1 parent f63b497 commit b3eada4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/EntitySchemaBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use GraphQL\Doctrine\DefaultFieldResolver;
use GraphQL\Doctrine\Types;
use GraphQL\GraphQL;
use GraphQL\Server\OperationParams;
use GraphQL\Server\ServerConfig;
use GraphQL\Server\StandardServer;
use GraphQL\Type\Definition\ObjectType;
Expand Down Expand Up @@ -462,4 +463,11 @@ public function mutation(string $name): Mutation {
$this->mutators[$name] = $mutation;
return $mutation;
}
}

public static function createServerOperation(array $json): OperationParams {
return OperationParams::create([
'query' => $json['query'],
'variables' => $json['variabes'] ?? null,
]);
}
}

0 comments on commit b3eada4

Please sign in to comment.