This is a Next.js project bootstrapped with create-next-app. It demonstrates how to use Strawberry, FastAPI, SQLAlchemy, and NextJS together. It makes use of graphql-codegen to automatically generate urql hooks based on GraphQL API that are ready to use in your React/NextJS code.
First, install the Python dependencies:
$ pip install -r requirements.txt
Next, install the npm based dependencies:
$ npm install
Create the db:
$ python models.py
Now, run the uvicorn server:
$ uvicorn app:app --reload --host '::'
Finally, run the NextJS development server:
npm run dev
# or
yarn devNow you can go to http://127.0.0.1:3000/graphql to explore the interactive GraphiQL app and start developing your NextJS app.