Skip to content

sachnaror/GraphQL_FastAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL FastAPI Example

This repository contains a simple example of integrating GraphQL with FastAPI, a modern, fast (high-performance) web framework for building APIs with Python. The project demonstrates how to set up a GraphQL server using FastAPI and interact with it using GraphQL queries.

Features

  • FastAPI: Utilizes FastAPI for building robust and high-performance APIs.
  • GraphQL Integration: Demonstrates how to integrate GraphQL with FastAPI.
  • Sample Schema: Provides a sample GraphQL schema with example queries and mutations.
  • Interactive API Documentation: Utilizes Swagger UI and Redoc to generate interactive API documentation.

Requirements

  • Python 3.7+
  • pip

Installation

  1. Clone the repository:

    git clone https://github.com/sachnaror/GraphQL_FastAPI.git
  2. Navigate to the project directory:

    cd GraphQL_FastAPI
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

  1. Run the FastAPI server:

    uvicorn main:app --reload
  2. Access the GraphQL playground in your browser:

    http://localhost:8000/graphql

Use the GraphQL playground to interact with the API by executing queries and mutations.

API Documentation

  • Swagger UI: Access the Swagger UI for interactive API documentation:

    http://localhost:8000/docs
  • Redoc: Alternatively, access API documentation using Redoc:

    http://localhost:8000/redoc

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve this project.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

GraphQL server using FastAPI and interact with it using GraphQL queries

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages