Skip to content

Latest commit

 

History

History

fastapi

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Example of a GraphQL API using Strawberry and FastAPI

This examples shows you how to setup Strawberry with FastAPI

How to use

  1. Install dependencies

Use poetry to install dependencies:

poetry install
  1. Run the server

Run uvicorn to run the server:

poetry run uvicorn main:app --reload
  1. Access the GraphiQL IDE and explore the schema at http://localhost:8000/graphql

Example query

query AllTopRatedMovies {
  topRatedMovies {
    imageUrl
    imdbId
    imdbRating
    imdbRatingCount
    title
    year
  }
}