https://github.com/francostino/f1-graphql-api
A comprehensive and flexible GraphQL API that provides access to historical and real-time Formula 1 data.
https://github.com/francostino/f1-graphql-api
apollo apollographql f1 formula1 gqloom graphql graphql-yoga lando prisma prisma-orm typescript
Last synced: about 2 months ago
JSON representation
A comprehensive and flexible GraphQL API that provides access to historical and real-time Formula 1 data.
- Host: GitHub
- URL: https://github.com/francostino/f1-graphql-api
- Owner: FrancoStino
- License: mit
- Created: 2025-05-03T11:50:15.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-04-16T09:57:01.000Z (2 months ago)
- Last Synced: 2026-04-16T11:30:52.780Z (2 months ago)
- Topics: apollo, apollographql, f1, formula1, gqloom, graphql, graphql-yoga, lando, prisma, prisma-orm, typescript
- Language: TypeScript
- Homepage: https://f1-graphql.davideladisa.it/
- Size: 15.1 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Codeowners: CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
F1 GraphQL
The Ultimate GraphQL API for Formula 1 Data
All F1 history and statistics at your fingertips through GraphQL
[](https://opensource.org/licenses/MIT)
[](https://github.com/FrancoStino/F1-GraphQL/releases)

[](https://sonarcloud.io/summary/new_code?id=FrancoStino_F1-GraphQL)
## Table of Contents
- [โจ Features](#-features)
- [๐ฌ Demo](#-demo)
- [๐ Quick Start](#-quick-start)
* [Prerequisites](#prerequisites)
* [Installation](#installation)
- [๐ API Endpoints](#-api-endpoints)
- [๐ Example Queries](#-example-queries)
* [Get first ten Drivers](#get-first-ten-drivers)
* [Find Race Results for a Specific Grand Prix](#find-race-results-for-a-specific-grand-prix)
- [๐ ๏ธ Tech Stack](#-tech-stack)
- [๐ Project Structure](#-project-structure)
- [๐ CI/CD Workflows](#-cicd-workflows)
- [๐ License](#-license)
- [๐จโ๐ป Author](#-author)
- [๐ Acknowledgements](#-acknowledgements)
- **๐ Dual GraphQL Engines** - Choose between Apollo Server and GraphQL Yoga interfaces
- **๐ Complete F1 Database** - Access comprehensive Formula 1 historical data
- **๐ Automated Updates** - Database refreshed daily with the latest F1 statistics
- **โก High Performance** - Built on modern Node.js with TypeScript and Prisma v7 ORM (Direct TCP)
- **๐งฉ Rich Query Options** - Filter, paginate, and explore F1 data with flexible queries
Watch F1 GraphQL in action
- Node.js (v22.12+ or v24.0+)
- Yarn package manager
- PostgreSQL database
- [Lando](https://lando.dev/)
```bash
# Clone the repository
git clone git@github.com:FrancoStino/F1-GraphQL.git
# Navigate to the project directory
cd F1-GraphQL
# Configure your environment
cp .env.example .env
# Edit .env with your database connection string
# Start Lando
lando start
# Import from ZIP archive
lando db-import db/f1db-sql-postgresql-single-inserts.zip
# Install dependencies
yarn install
# Generate Prisma client (v7 with Direct TCP)
yarn generate
# Start development server
yarn dev
```
### Export database to ZIP file
```bash
lando db-export
```
Once running, access your GraphQL API through:
| Endpoint | URL | Description |
|----------|-----|-------------|
| ๐ **Landing Page** | `http://localhost:4000/` | Main welcome page with links |
| ๐งช **GraphQL Yoga** | `http://localhost:4000/graphql` | GraphiQL interface for testing |
| ๐ **Apollo Server** | `http://localhost:4000/apollo` | Apollo Sandbox environment |
```graphql
query Drivers {
findManyDriver(take: 10) {
id
firstName
lastName
name
fullName
gender
dateOfBirth
}
}
```
### Find Race Results for a Specific Grand Prix
```graphql
query Race {
findManyRace(take: 50) {
year
turns
laps
}
}
```
**๐ Updated to Prisma v7 with Direct TCP connectivity for optimal performance**
GQLoom
TypeScript
GraphQL
Prisma v7
Apollo
Yoga
Lando
```
f1-graphql/
โโโ .github/ # GitHub Actions workflows for CI/CD
โโโ assets/ # Static assets (images, CSS)
โโโ prisma/ # Database schema and generated client
โโโ src/
โ โโโ providers/ # Database client provider
โ โโโ resolvers/ # GraphQL resolvers configuration
โ โโโ schema/ # GraphQL schema generation
โ โโโ servers/ # Server configurations
โ โ โโโ ApolloServer.ts
โ โ โโโ Express.ts
โ โ โโโ GraphQL-Yoga.ts
โ โ โโโ LandingPage.ts
โ โโโ utils/ # Utility functions
โ โโโ index.ts # Main entry point
```
This project uses GitHub Actions for:
- **Daily Data Updates**: Automatically refreshes the F1 database
- **Release Management**: Generates changelogs and tags
- **Branch Syncing**: Keeps development branches in sync
This project is licensed under the MIT License.
**Davide Ladisa**
- [F1DB](https://github.com/f1db/f1db) - The comprehensive Formula 1 database
- [GQLoom](https://gqloom.dev/) - GraphQL tooling that powers our schema
---
๐๏ธ Ready to race with F1 data? Star this repo and buckle up! ๐