mirumee / ariadne-codegen

Generate fully typed Python client for any GraphQL API from schema, queries and mutations
BSD 3-Clause "New" or "Revised" License
236 stars 30 forks source link

Field/Type descriptions from schema could be added to the generated code. #117

Open strue36 opened 1 year ago

strue36 commented 1 year ago

This will presumably result in a similar discussion to this. https://github.com/jhnnsrs/turms/pull/54

I've implemented this as docstrings on a local branch using similar logic to that used in turms.

strue36 commented 1 year ago

I originally thought that this is what the include_comments flag was for.

mat-sop commented 1 year ago

I think optional descriptions could be added to the generated code, but first, we should clarify the include_comments description in the readme.

mat-sop commented 1 year ago

To give more context, we're using ast to generate python code, but in this library there is no way to represent comments. So adding descriptions in form of comments is quite difficult, but we still can do it like turms - using docstrings or description= attribute.