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 null being passed to a nullable argument that is a list of type #1016

Merged
merged 5 commits into from
Oct 16, 2019

Conversation

spawnia
Copy link
Collaborator

@spawnia spawnia commented Oct 16, 2019

  • Added or updated tests
  • Updated the changelog

Changes

The new TypedArgs wrapper produced an error when a client passes null as the value of an argument that is defined as a list of type.

Failing test:

PHPUnit 8.4.1 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.3.9 with Xdebug 2.7.2
Configuration: /projects/lighthouse/phpunit.xml.dist

.E                                                                  2 / 2 (100%)

Time: 1.29 seconds, Memory: 28.00 MB

There was 1 error:

1) Tests\Unit\Execution\Arguments\TypedArgsTest::testNullableList
ErrorException: Invalid argument supplied for foreach()

/projects/lighthouse/src/Execution/Arguments/TypedArgs.php:149

Breaking changes

No

@spawnia spawnia added the bug An error within Lighthouse label Oct 16, 2019
@joskfg joskfg self-requested a review October 16, 2019 18:25
@spawnia spawnia merged commit 9dba7fd into master Oct 16, 2019
@spawnia spawnia deleted the typed-args-null-list branch October 16, 2019 20:15
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.

2 participants