Skip to content

Commit c8b95d1

Browse files
authored
Merge pull request #34 from lorado/bug/33
allow pipe definition with params
2 parents 31c12d9 + 23f59b1 commit c8b95d1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/GraphQL.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function execute($query, $variables = [], $opts = []) {
149149
* @return array
150150
* @static
151151
*/
152-
static public function formatGraphQLException($e): array {
152+
public static function formatGraphQLException($e): array {
153153
$debug = false;
154154

155155
// if debug mode is activated, we have to include debug message and

src/Support/Transformer/Transformer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ public function getArguments(Definition $definition) {
120120
if (is_callable($pipe)) {
121121
continue;
122122
}
123-
123+
// pipe string definition may contain parameters, that are separated from the pipe class name with semicolon
124+
$parsedPipeString = explode(':', $pipe, 2);
124125
// a class pipe can handle argumentable interface
125-
$pipe = $this->app->make($pipe);
126+
$pipe = $this->app->make($parsedPipeString[0]);
126127

127128
if ($pipe instanceof \StudioNet\GraphQL\Support\Pipe\Argumentable) {
128129
$args = array_merge($args, $pipe->getArguments($definition));

0 commit comments

Comments
 (0)