-
Notifications
You must be signed in to change notification settings - Fork 2k
Consider turning validation of fields with dunderscore prefix back into warning. #1184
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
Comments
Thanks for highlighting this - I agree there should be an escape hatch for this. For some context on that discussion you're referring to, I'll keep this issue open to track an escape hatch for the error. We'll get something in place before the next release |
Makes total sense 👍 I’d be happy to make a PR for this. Would you want it to work the same way as previously? (Upside is that the env var that people may already have set would continue to work.) |
I've got one in progress I'll put up in a couple minutes and ping you for your thoughts |
This offers an escape hatch for schema that are defined with legacy field names that were valid in older versions of the spec and no longer are via an explicit white-list. Fixes #1184
This offers an escape hatch for schema that are defined with legacy field names that were valid in older versions of the spec and no longer are via an explicit white-list. Fixes #1184
Based on some old discussion (not sure where anymore so can’t provide links) we decided to use
__id
for global object IDs in our schema.Recently, an initial change to the name validation started throwing errors for fields starting with a dunderscore. This was then turned into a warning so legacy schemas wouldn’t immediately fail to load. But then this recent change turned the warnings into hard errors again.
While I completely understand that this name is not in line with the spec, graphql-js is < v1 which according to semver means anything can change, and in principle throwing an error makes sense; the problem is that I’d rather not have to make very hard breaking changes to our schema (and break current iOS app versions) until either:
I think the previous logged warning was big enough that people wouldn’t adopt new fields in their schema that use a dunderscore prefix.
PS: I’m mostly making this case for others in the community, I have no problem simply disabling the check in our apps.
The text was updated successfully, but these errors were encountered: