Skip to content

Check for valid field arg names #145

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

Merged
merged 2 commits into from
Sep 1, 2015
Merged

Conversation

jmandel
Copy link
Contributor

@jmandel jmandel commented Aug 21, 2015

If I've understood the intent of https://facebook.github.io/graphql/#sec-Names, field arg names are restricted to /^[_a-zA-Z][_a-zA-Z0-9]*$/.

Currently the js implementation allows the creation of non-conformant field arg names, which means you can create a field arg that a client can't actually reference in a query.

This PR adds a test for field arg name validity.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@leebyron
Copy link
Contributor

Fantastic suggestion. Would you mind applying the same to the fields themselves?

@jmandel
Copy link
Contributor Author

jmandel commented Aug 24, 2015

Applied.

leebyron added a commit that referenced this pull request Sep 1, 2015
Check for valid field arg names
@leebyron leebyron merged commit 4ff563e into graphql:master Sep 1, 2015
@leebyron
Copy link
Contributor

leebyron commented Sep 1, 2015

Great, thank you!

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

Successfully merging this pull request may close these issues.

3 participants