Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 1.17 KB

README.md

File metadata and controls

11 lines (6 loc) · 1.17 KB

Yes, that is generally a good approach for organizing your code when using GraphQL and SQLAlchemy.

In the api folder, you can define GraphQL queries and mutations that correspond to the different operations that you want to expose to your API clients. These can be grouped by entity or by functionality, depending on your preference and the needs of your application.

In the model folder, you can define the SQLAlchemy models that correspond to the different entities in your application. These models can be used to represent the structure of your data in the database, and to define relationships between different entities.

In the database folder, you can define the database connection classes that are used to perform operations on the corresponding models. These classes can be responsible for connecting to the database, executing queries and updates, and returning the results to the calling code.

By organizing your code in this way, you can keep the different aspects of your application separate and maintain a clear separation of concerns. This can make it easier to understand and maintain your codebase over time.

I hope this helps! Let me know if you have any further questions.