Overview:
The author of this article introduces a template that they have created for starting GraphQL projects with Python. They explain that they experienced difficulties and wrote a lot of boilerplate code when starting out with GraphQL projects in Python, which led them to develop this template. The template incorporates modern libraries and aims to provide the best developer experience.
Features:
- Built for Flask 2.0.1: The template is designed to work with Flask version 2.0.1.
- Works with Python 3.8: The template is compatible with Python version 3.8.
- Uses Graphene for the GraphQL schema: Graphene, a GraphQL library for Python, is utilized in the template for the GraphQL schema.
- Pre-Configured Jinja2 email templates: The template comes with pre-configured Jinja2 email templates, making it easier to handle email functionality.
- Built-in support for sending emails: The template includes built-in support for sending emails.
- Postgres and SQLAlchemy support: The template supports Postgres as the database and utilizes the SQLAlchemy library.
- Uses Pipenv to manage dependencies: Pipenv, a dependency management tool, is used in the template to manage project dependencies.
- Comes with support for Flask-CORS: The template includes support for Flask-CORS, which enables Cross-Origin Resource Sharing in Flask applications.
- Offers complete Relay support: The template provides complete support for Relay, a JavaScript framework for building data-driven React applications.
- GraphQL file uploads support: The template supports file uploads in GraphQL.
- Batch querying support: The template has batch querying support, which is useful for use with the Apollo Client.
- Follows the official Shopify GraphQL Design guide: The template follows the official Shopify GraphQL Design guide, ensuring adherence to best practices.
- Uses Pytest and FactoryBoy for testing: Pytest and FactoryBoy are used in the template for testing purposes.
- DataLoader support: The template includes DataLoader support, which helps resolve the n+1 problem in GraphQL.
- Uses Cerberus for input validation: The template uses Cerberus, a lightweight data validation library, for input validation.
- Comes with an authentication system: The template includes an authentication system that handles various functionalities like user email confirmation, forgot password/password reset, verified email/password changes, user creation/login, and user authentication with Flask-Login.
- Storing passwords with Argon2: The template uses Argon2 for storing passwords, which is a secure password hashing algorithm.
Summary:
In this article, the author introduces a template for starting GraphQL projects with Python. They explain that the Pythonecosystem has fewer resources for getting started with GraphQL, which led them to develop this template. The template incorporates modern libraries, offers various features to enhance the developer experience, and includes an authentication system and testing support. However, the article does not provide installation instructions or code snippets.