Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rscarrera27/flask-graphql-large-application-example
✨How to structure GraphQL server with flask+graphene✨
https://github.com/rscarrera27/flask-graphql-large-application-example
flask flask-graphql graphene graphql graphql-api graphql-mongoengine tutorial
Last synced: 4 months ago
JSON representation
✨How to structure GraphQL server with flask+graphene✨
- Host: GitHub
- URL: https://github.com/rscarrera27/flask-graphql-large-application-example
- Owner: rscarrera27
- License: mit
- Created: 2018-03-31T11:56:17.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T20:18:50.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T13:04:08.945Z (4 months ago)
- Topics: flask, flask-graphql, graphene, graphql, graphql-api, graphql-mongoengine, tutorial
- Language: Python
- Homepage:
- Size: 104 KB
- Stars: 56
- Watchers: 1
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ✨✨Flask-GraphQL-Large-Application-Example✨✨
## Summary
This is how I structure my GraphQL server with Flask + Graphene## About
This is basic example of large Flask+Graphene server.
all essential use examples have been covered and advanced use examples will be added step by step- Features
- [x] Query example
- [x] Mutauion example
- [x] Union example
- [x] Field example
- [ ] Relay example
- [ ] InputObjectType example
- [ ] Dataloader example
- [ ] Middleware example
- [ ] Interfaces example
- [ ] AbstractTypes example
- [x] Basic authentication example
- [x] MongoDB example
- [ ] MySQL(SQLAlchemy, PeeWee) example
## Project dependencies
- GraphQL framework
- Graphene
- HTTP serving
- Flask-GraphQL
- Flask
- Database ORM
- Mongoengine
- Authentication
- [Flask-GraphQL-Auth](https://flask-graphql-auth.readthedocs.io/en/latest/) (JWT based authentication)## How to test this example?
This repository implemented minitwit to cover examples. Use the following command to run the server```sh
pip install -r requirements.txt
python server.py
```
GraphiQL enabled by default.## Diagrams
not covered## Core components
### /Server/app/schema
GraphQL 서버를 구성하는 필드, 쿼리, 뮤테이션을 담고 있습니다.This directory contains fields, queries, and interactions that make up the GraphQL schema
#### /Server/app/schema/__init__.py
GraphQL 스키마를 구성하고 구성된 스키마를 Flask 인스턴스에 할당합니다.Structure GraphQL schema and add schema with flask.add_url_rule
#### /Server/app/schema/fields.py
GraphQL 쿼리와 뮤테이션에서 사용하는 필드들This file contains the fields that make up the GraphQL schema.
#### /Server/app/graphql_view/unions.py
GraphQL 쿼리와 뮤테이션에서 사용하는 유니온들This file contains the unions that make up the GraphQL schema.
#### /Server/app/schema/queries
이 디렉터리는 쿼리와 쿼리 resolver들로 구성됩니다. 유연한 구조를 위해 resolver들을 독립적인 파일에 담습니다This directory consists root query class and query resolvers. Place the resolver in an independent file for flexible structure
#### /Server/app/schema/mutations
이 디렉터리는 뮤테이션들로 구성됩니다. 유연한 구조를 위해 뮤테이션들을 독립적인 파일에 담습니다This directory consists mutations. Place the mutation in an independent file for flexible structure
## I refered
### People
[Syrus Akbary](https://twitter.com/syrusakbary)### Repository
[Flask-Large-Application-Example](https://github.com/JoMingyu/Flask-Large-Application-Example)### Website
[Designing GraphQL mutations](https://dev-blog.apollodata.com/designing-graphql-mutations-e09de826ed97)
[Authorization in GraphQL](https://dev-blog.apollodata.com/authorization-in-graphql-452b1c402a9)
[GraphQL ansd authentication](https://medium.com/the-graphqlhub/graphql-and-authentication-b73aed34bbeb)### Library Docs
[Graphene](https://medium.com/the-graphqlhub/graphql-and-authentication-b73aed34bbeb)