-
Notifications
You must be signed in to change notification settings - Fork 4
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
Tool cannot handle fields with name self
#20
Comments
Some more information on keywords where the raw string handling doesn't work: https://internals.rust-lang.org/t/raw-identifiers-dont-work-for-all-identifiers/9094. |
It seems like this function attempts to handle it but it apparently doesn't work as intended: https://github.com/banool/async-graphql-reverse/blob/5cea02a58e84c25ce2989a48b0d069d2c095018d/src/render/fields.rs#L364. |
This is a little tricky to solve because it depends on how the generated types are used. For example I want to use the types with serde, so you'd need some custom serde attributes. If they're being used with serde, the field can be renamed and an attribute can be applied. But this library doesn't really focus on that use case. |
The graphql-client generates code that looks like this, which is pretty much what I'd hope for here:
|
I solve this in my fork here: https://github.com/banool/async-graphql-reverse/. |
It is valid to have fields with the name
self
in a GraphQL schema but the tool doesn't handle it well:The text was updated successfully, but these errors were encountered: