Skip to content
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

Is it necessary to prevent a datasclass field name from being a Python keyword? #1348

Open
paulfelix opened this issue Jul 14, 2021 · 1 comment

Comments

@paulfelix
Copy link

I ran into this error when dynamically creating an dataclass:

"Field names must not be keywords: {name!r}"
https://github.com/graphql-python/graphene/blob/master/graphene/pyutils/dataclasses.py#L1196-L1197

The field names come from a defined external dataset, and one field name happens to be a Python keyword, but I don't think that causes any harm.

@simonw
Copy link

simonw commented Nov 17, 2021

I just ran into this one too. My application generates a GraphQL API from a database schema, and one of the database tables I'm trying to work with has a column called if.

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

No branches or pull requests

2 participants