Skip to content

rscarrera27/Flask-GraphQL-Large-Application-Example

Repository files navigation

✨✨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
    • Query example
    • Mutauion example
    • Union example
    • Field example
    • Relay example
    • InputObjectType example
    • Dataloader example
    • Middleware example
    • Interfaces example
    • AbstractTypes example
    • Basic authentication example
    • MongoDB example
    • MySQL(SQLAlchemy, PeeWee) example

Project dependencies

  • GraphQL framework
    • Graphene
  • HTTP serving
    • Flask-GraphQL
    • Flask
  • Database ORM
    • Mongoengine
  • Authentication

How to test this example?

This repository implemented minitwit to cover examples. Use the following command to run the server

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

Repository

Flask-Large-Application-Example

Website

Designing GraphQL mutations
Authorization in GraphQL
GraphQL ansd authentication

Library Docs

Graphene

Releases

No releases published

Packages

No packages published

Languages