A project that makes use of async sqlalchemy, fastapi and supports relay style pagination with postgres as the db. #1863
Unanswered
vamshiaruru
asked this question in
Show and tell
Replies: 1 comment
-
This is really cool project. good resource to learn how to use strawberry in larger projects edit: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey guys, recently I had to make a choice between using graphene/strawberry with fastapi for my new project. I started with graphene but I quickly got lost (most of the documentation seemed to be for django, and the support for fastapi was not very good), so I started evaluating strawberry. I liked it much better (and the fastapi integration is much better). One thing that graphene had that strawberry didn't was inbuilt support for relay, and filtering. I was also not very sure how to do cursor based pagination working in more complex use cases.
There were also many small things like how to structure your sorters/filters, how to instantiate only one instance of each dataloader, how to pass the db session to context and so on. There were answers available all over the internet for these questions, but I thought it would be good to have all of the answers in one place.
So once I got my project up and working, I made this demo project: https://github.com/vamshiaruru/strawberry_async_sqlalchemy_relay . In this project I use
and so on.
I used a relatively more complex data modeling (There's a resource table and a tag table, and there's a many to many relationship between them) than most tutorials I found online to show how to write sorters/filters for non trivial use cases. There's also a
PaginationHelper
class that helps with paginating data and buildingConnection
objects.A more detailed explanation can be found in the demo project's README.md file. Hopefully this helps/saves time for some of you who are just starting out with this tech stack.
Feel free to ask questions/give feed back. Thank you :)
Beta Was this translation helpful? Give feedback.
All reactions