Apollo GraphQL Server on Cloudflare Workers

desktop website

A small proof of concept to run Apollo GraphQL servers on Cloudflare workers. Copilottravel.com, a startup that is building the next generation travel search and booking engine, asked me to make a small example on how to run Apollo GraphQL servers on Cloudflare workers. For their travel search engine they need combined data from dozens of different sources. GraphQL was made for these kinds of applications.

Copilottravel already started their development on Google Cloud Services because CGS is node js compatible. But they plan to run everything on Cloudflare because it has much more point of presence and is faster than GCS.

The Apollo server products are built for and with nodejs and do not run by default on the Cloudflare Workers platform because the latter does not support node js. With the help of an experimental package from Apollo and some guidance from the Cloudflare Workers product manager, I was able to get a few graphql services running on Workers and establish a basic connection to Apollo Studio (the management app for Apollo services). My work gave them a handle to continue their porting efforts from Google Cloud to Cloudflare.

Keywords:
Javascript, Apollo Server, Apollo Gateway, Cloudflare Workers, Serverless