-
Notifications
You must be signed in to change notification settings - Fork 46
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
Schema Parsing Fails with ""
is not a valid identifier on empty names
#252
Comments
""
is not a valid identifier""
is not a valid identifier on empty names
Hi @adimit, thanks for the report - I didn’t realise this was a common pattern (although it makes sense - I have usually just used a named field to simulate an empty type, but this is a little more obvious) This seems to be a bug in the “to_snake_case” method we’re using. Got a fix ready for that, although it’s not all that needs done unfortunately - underscore isn’t a valid rust identifier so will need to figure out a way to support it in the various places it appears in the cynic output |
#### Why are we making this change? As reported in #252 - it's a common pattern to name a field with an underscore when you have an otherwise empty type (as empty types are not supported in graphql). Cynic does not support this (nor does rust). #### What effects does this change have? Adds support for underscore fields in schemas, and adds renames to the query fragment derive so that you can work around rusts lack of support for `_` fields. Fixes #252 Does part of #151
Fix for this is now released in v0.14.0 |
Cool, that's great. Thanks for the quick fix. |
The following declaration causes an error in proc macro expansion when using
use_schema!()
:The error is:
This is a common workaround to represent empty types and should probably be supported.
The text was updated successfully, but these errors were encountered: