crystal icon indicating copy to clipboard operation
crystal copied to clipboard

Adaptor for fastify@v5

Open MarioSimou opened this issue 1 year ago • 3 comments

Feature description

Currently, PostGraphile supports Fastify version 4 only. However, with the recent release of Fastify version 5, we aim to extend our support to include this latest version

Supporting development

I [tick all that apply]:

  • [x] am interested in building this feature myself
  • [x] am interested in collaborating on building this feature
  • [ ] am willing to help testing this feature before it's released
  • [ ] am willing to write a test-driven test suite for this feature (before it exists)
  • [ ] am a Graphile sponsor ❤️
  • [ ] have an active support or consultancy contract with Graphile

MarioSimou avatar Oct 28 '24 15:10 MarioSimou

The main thing when doing this is to ensure that the fastifyv5 request context entry is registered; it should look like:

https://github.com/graphile/crystal/blob/19420562a3d7b49e3cde8f4ff0ece5b8286e43d8/grafast/grafserv/src/servers/fastify/v4/index.ts#L28-L37

You code should not import from fastify at all - only types should be imported.

benjie avatar Oct 28 '24 15:10 benjie

Do you know some workaround to use postgraphile with Fastyfy v5? Actually looks like v4 adapter works with Fastyfy v5

andriy-f avatar Nov 11 '25 21:11 andriy-f

Please feel free to submit an adaptor! Probably you just need to copy the v4 one and replace all instances of v4 with v5 and it’ll probably work 🤷‍♂️

benjie avatar Nov 12 '25 00:11 benjie