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

Fix request variables validation #239

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fix request variables validation #239

wants to merge 4 commits into from

Conversation

Jalle19
Copy link
Collaborator

@Jalle19 Jalle19 commented Jan 13, 2020

Fixes #238

Sam Stenvall added 4 commits January 13, 2020 16:28
The error checking should be done in RequestValidator instead, and it already takes care of this use case
$this->assertEquals([
'errors' => [
[
'message' => 'Variable "episode" does not exists',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@leoloso this is the error you expect, right?

Copy link

Choose a reason for hiding this comment

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

I think the more important error is that the variable is not defined in the operation name, which is mandatory in GraphQL. Hence the error should be something like Variable "episode" has not been defined in the operation name

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jan 13, 2020

Hmm, this is going to need some more work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP Fatal error when a variable is missing from operation name and dictionary of values
2 participants