Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle nullable input objects in TypedArgs conversion #1021

Merged
merged 7 commits into from
Oct 21, 2019

Conversation

spawnia
Copy link
Collaborator

@spawnia spawnia commented Oct 21, 2019

  • Added or updated tests
  • Updated the changelog

Changes

Converting client-given args to an ArgumentSet fails when null is given for an argument that is defined as an input.

Added a failing test:

1) Tests\Unit\Execution\Arguments\TypedArgsTest::testNullableInputObject
TypeError: Argument 1 passed to Nuwave\Lighthouse\Execution\Arguments\TypedArgs::wrapArgs() must be of the type array, null given, called in /var/www/src/Execution/Arguments/TypedArgs.php on line 193

/var/www/src/Execution/Arguments/TypedArgs.php:91

It works now.

Breaking changes

No

@spawnia spawnia added the bug An error within Lighthouse label Oct 21, 2019
Copy link
Collaborator

@olivernybroe olivernybroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine :)

src/Execution/Arguments/TypedArgs.php Outdated Show resolved Hide resolved
@spawnia spawnia merged commit d25557c into master Oct 21, 2019
@spawnia spawnia deleted the typed-args-nullable-input-object branch October 21, 2019 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error within Lighthouse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants