A GraphQL proxy for the BoardGameGeek API, built with Apollo Server v4 and deployed on Vercel.
- GraphQL Endpoint:
https://your-project.vercel.app/graphql - Health Check:
https://your-project.vercel.app/health - Root:
https://your-project.vercel.app/
- Node.js 20+
- npm
# Install dependencies
npm install
# Build the project
npm run build
# Start development server
npm run devThe GraphQL endpoint will be available at http://localhost:4000/graphql
- Vercel CLI installed
- Git repository
# Install Vercel CLI
npm install -g vercel
# Login to Vercel
vercel login
# Deploy to Vercel
vercel --prodSet these in your Vercel dashboard:
REDIS_URL(optional): Your Redis connection string for cachingBGG_API_BASE_URL(optional): Defaults tohttps://boardgamegeek.com/xmlapi2NODE_ENV: Automatically set toproductionby Vercel
The API provides access to BoardGameGeek data through a clean GraphQL interface:
- Game: Board game information
- Search: Search functionality for games
- Thing: Detailed game data from BGG
query SearchGames {
search(query: "Catan") {
id
name
yearPublished
minPlayers
maxPlayers
playingTime
averageRating
numRatings
}
}query GetGameDetails {
thing(id: "13") {
id
name
yearPublished
minPlayers
maxPlayers
playingTime
averageRating
numRatings
description
categories
mechanics
designers
artists
publishers
}
}query GetTopGames {
search(query: "top") {
id
name
yearPublished
averageRating
numRatings
}
}npm start- Start production servernpm run dev- Start development server with hot reloadnpm run build- Build TypeScript to JavaScriptnpm run vercel-build- Build for Vercel deploymentnpm run generate-types- Generate TypeScript types from GraphQL schema
├── src/
│ ├── datasources/ # Data source implementations
│ │ ├── bggDataSource.ts # BGG API integration
│ │ └── index.ts
│ ├── resolvers/ # GraphQL resolvers
│ │ └── index.ts
│ ├── schema/ # GraphQL schema
│ │ └── schema.graphql
│ └── generated/ # Auto-generated types
│ └── graphql.ts
├── dist/ # Compiled JavaScript
├── index.ts # Main server file
├── vercel.json # Vercel deployment config
├── package.json
└── tsconfig.json
- Apollo Server v4: GraphQL server with Express integration
- TypeScript: Type-safe development
- Express: Web framework
- Vercel: Serverless deployment platform
- Redis: Caching layer (optional)
- CORS: Cross-origin resource sharing
- Axios: HTTP client for BGG API
- xml2js: XML parsing for BGG responses
- Go to Apollo Studio
- Enter your endpoint:
https://your-project.vercel.app/graphql - Start exploring the schema and running queries!
- Vercel Deployment Guide - Detailed Vercel deployment instructions
Note: This is a proxy service for the BoardGameGeek API. All game data is sourced from BoardGameGeek.com.