-
Notifications
You must be signed in to change notification settings - Fork 822
ObjectType.resolve_type classmethod makes it impossible to have a field named 'type' #50
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 such a detailed example @inklesspen. |
Added sqlalchemy utils type TSVectory
this is still a problem on graphene.Interface - resolve_type is a classmethod there.. |
Ha, that is a good point @svilendobrev ! @syrusakbary should probably rename the function to |
Using type as a variable is an anti-pattern in Python as it overwrites a built-in function, not to mention the use of |
Using type as a variable in Python code and using type as a field in a schema to send data between several systems, many of which may not be written in Python, are two different scenarios. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The
resolve_type
method onObjectType
conflicts with actually resolving a field calledtype
. Given the importance ofresolve
method names, I think great care should be taken to make sure graphene's codebase does not use these method names unless necessary.The below test fails with
GraphQLError("'Location' object has no attribute 'T'",)
; renaming theresolve_type
method to_resolve_type
solves the problem.The text was updated successfully, but these errors were encountered: