Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions api/src/util/graphqlProxy.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import httpProxy from '@fastify/http-proxy'
import type { FastifyInstance, HookHandlerDoneFunction } from 'fastify'
import type { FastifyInstance, FastifyPluginOptions } from 'fastify'

import { getUserProjectConfig } from './project'

/**
* Graphql Proxy - Takes studio "/proxies/graphql" and forwards to the projects
* graphql endpoint
* done() has been removed from the signature as fastify/fastify#5141 PR changed the signature
*/
export async function graphqlProxy(
fastify: FastifyInstance,
_options: never,
done: HookHandlerDoneFunction
_options: FastifyPluginOptions,
) {
const webConfig = getUserProjectConfig().web
const webHost = webConfig.host ?? 'localhost'
Expand All @@ -25,6 +25,4 @@ export async function graphqlProxy(
rewritePrefix: '/' + graphqlEndpoint.split('/').slice(3).join('/'),
disableCache: true,
})

done()
}