-
Notifications
You must be signed in to change notification settings - Fork 86
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
Code Completion In Pycharm #205
Comments
could you elaborate? You mean completion when building the query (creating an operation) or interpreting the results? |
Ideally both, but I think most value would come from code completion when building operations. |
When generating the schema would it be enough to add type hints? Replacing:
With:
Although I am not familiar with the details or differences between Type and Field classes. But this is similar to how dataclasses work. |
this is unfeasible as it is. I'd need to check if we can make This is one of the weakest spots of typechecking in python... if you do metaclasses transformations (like in my case it will get a class attribute and create ANOTHER instance attribute based on that... but it's not the same (one is a description, the other is a value based on that description). And Python ecosystem is full of metaclasses to save typing and autogenerate code (ex: all ORMs, such as Django...) AFAIU dataclasses and similar are manually crafted in the type checking... but for not-so-famous projects we're hopeless :-( |
Thanks for taking time to think about this. If it's ever implemented I will definitely use this library in future. |
yeah, I feel your pain... at work I'm using mostly TypeScript and when I have to go typeless it's a major issue. OTOH in TypeScript such things are a bit easier to write, since there is no "metaclass" stuff are derived from object mapping and one can easily do something like "for each object key, if the value type is X, do something, if it's Y, do another thing"... |
btw, stay tuned in #129, it's almost the same issue |
This is a great library and almost exactly what I've been looking for. Do you know if there is a way to make code completion work in PyCharm for the auto generated schema? A functioning autocomplete would make this an zero fiction way to interact with graphql APIs.
The text was updated successfully, but these errors were encountered: