Closed PORTB closed 9 months ago
Hi :wave:
I dont think there is a workaround in place for that. This is a special case that needs to be addressed in this function https://github.com/app-sre/qenerate/blob/main/qenerate/plugins/pydantic_v1/mapper.py#L54
Like adding a simple check to remove any trailing special char from the string
Latest version 0.6.4
should work now. In your specific case it would result in field name q_id
(note, that we consider id
a reserved keyword, so we prepend it with q_
. See https://github.com/app-sre/qenerate/blob/main/qenerate/plugins/pydantic_v1/mapper.py#L7)
Please re-open this issue if you still witness any problems.
Hi, I am interacting with a graphql endpoint (not under my control) that has a field that begins with an underscore, my query looks similar to this:
And pydantic throws an error with this:
NameError: Fields must not use names with leading underscores; e.g., use 'id' instead of '_id'.
Is there a workaround for this?