Skip to content
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

Split out strawberry packages for core functionality and support/hosting #1870

Closed
djfurman opened this issue May 2, 2022 · 1 comment
Closed

Comments

@djfurman
Copy link

djfurman commented May 2, 2022

Currently, strawberry is one repo and deployment on PyPI including

  • Schema generation
    • including cross-definition support with pydantic
  • Resolver mapping
  • Dev Server
  • GraphiQL IDE/Testing
  • CLI
  • Transport integration
    • aiohttp
    • sanic
    • web socker subscriptions
  • Server Integration
    • asgi
    • chalice (which has been largely replaced by AppSync out of the box)
    • django
    • fastapi
    • flask

Submitted for consideration, there appear to be three major components to the application

  1. Schema Generation/Transpilation
  2. Dev Support (local/debug server) & GraphiQL query exploration
  3. Deployment integration (integration with other Python server projects to host production-grade deployment)

I believe that splitting these functions into separate repos and PyPI publications would allow for greater reuse and focused support/testing.

For example, you could bring together the dev environment/CLI with the schema creation to test a GraphQL API locally with the dev-env components only under dev dependencies.

This further ensures that you are not including a dev server's code in a prod deployment, this makes the code smaller/faster as well as innoculating the codebase from CVEs for code that was never intended to be used in a production setting anyway.

Similarly, the produciton integrations become more modular to the core strawberry schema and handler demarkation which helps keep production tests and code light with dependencies as needed. You could even use the strawberry schema to support serverless applications by building (AppSync)[https://aws.amazon.com/appsync/] config and scaffolding one or more Lambda functions with Python and using aws-lambda-powertools for Python, to scaffold all of the resources necessary for development powered by strawberry.

I know there are implications to taking this step and having your application split across PyPI especially with regression tests, but if you're aligned with architecturally classifying components, it is possible! In my opinion, this is a stronger reuse basis of the project and can simplfy many of the concerns discussed at the PyCon2022 sprint. While I realize this would be a refactor, it may pay dividents to do it prior to the release of 1.x to allow these components to iterate within their bounded context and with the interface.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@patrick91
Copy link
Member

I'll close this, I think having one single package has been quite ok for us 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants