Skip to content

Commit

Permalink
Parameter #1 $type of method LastDragon_ru\LaraASP\GraphQL\SearchBy\A…
Browse files Browse the repository at this point in the history
…st\Usage<LastDragon_ru\LaraASP\GraphQL\SearchBy\Contracts\ComplexOperator|LastDragon_ru\LaraASP\GraphQL\SearchBy\Contracts\Operator>::get() expects string, string|null given.

Parameter #2 $scalar of class LastDragon_ru\LaraASP\GraphQL\SearchBy\Exceptions\DefinitionImpossibleToCreateType constructor expects string, string|null given.

Parameter #3 $nullable of class LastDragon_ru\LaraASP\GraphQL\SearchBy\Exceptions\DefinitionImpossibleToCreateType constructor expects bool, bool|null given.
  • Loading branch information
LastDragon-ru committed Aug 14, 2021
1 parent 81e8110 commit de82e0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion packages/graphql/src/SearchBy/Ast/Manipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ public function update(DirectiveNode $directive, InputValueDefinitionNode $node)
}

// Update
$operators = $this->metadata->getUsage()->get($name);
$node->type = $type;
$operators = $name
? $this->metadata->getUsage()->get($name)
: [];
}

// Update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
class DefinitionImpossibleToCreateType extends SearchByException {
public function __construct(
protected string $name,
protected string $scalar,
protected bool $nullable,
protected ?string $scalar,
protected ?bool $nullable,
Throwable $previous = null,
) {
parent::__construct(sprintf(
'Definition `%s`: Impossible to create type for scalar `%s`.',
$this->name,
$this->scalar.($this->nullable ? '' : '!'),
($this->scalar ?: 'null').($this->nullable ? '' : '!'),
), $previous);
}

public function getName(): string {
return $this->name;
}

public function getScalar(): string {
public function getScalar(): ?string {
return $this->scalar;
}

public function isNullable(): bool {
public function isNullable(): ?bool {
return $this->nullable;
}
}

0 comments on commit de82e0e

Please sign in to comment.