From d9644ee7e8ebcffda68fffa9612577778ea0678c Mon Sep 17 00:00:00 2001 From: Erik Beuschau Date: Fri, 20 Feb 2026 11:23:53 +0100 Subject: [PATCH 1/2] Use / for graphql endpoint --- src/graphql.ts | 9 +++++---- worker-configuration.d.ts | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/graphql.ts b/src/graphql.ts index b68aaba..f98d083 100644 --- a/src/graphql.ts +++ b/src/graphql.ts @@ -1,12 +1,13 @@ -import { createYoga } from "graphql-yoga"; +import { createYoga } from 'graphql-yoga' -import { schema } from "./schema"; +import { schema } from './schema' export const yoga = createYoga({ schema, batching: true, -}); + graphqlEndpoint: '/', +}) export default { fetch: yoga.fetch, -}; +} diff --git a/worker-configuration.d.ts b/worker-configuration.d.ts index 3abbf67..6bb174c 100644 --- a/worker-configuration.d.ts +++ b/worker-configuration.d.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -// Generated by Wrangler by running `wrangler types` (hash: b739a9c19cff1463949c4db47674ed86) -// Runtime types generated with workerd@1.20260219.0 2026-02-19 nodejs_compat +// Generated by Wrangler by running `wrangler types` (hash: e32b09e4b5ca118f20a449da2115a7dd) +// Runtime types generated with workerd@1.20260219.0 2026-02-19 declare namespace Cloudflare { interface GlobalProps { - mainModule: typeof import("./src/index"); + mainModule: typeof import("./src/graphql"); } interface Env { } From a88914e64aea80975eca4a3438c74b195b883adc Mon Sep 17 00:00:00 2001 From: Erik Beuschau Date: Fri, 20 Feb 2026 11:25:29 +0100 Subject: [PATCH 2/2] Fix test --- src/graphql.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/graphql.test.ts b/src/graphql.test.ts index 6784121..2fe3748 100644 --- a/src/graphql.test.ts +++ b/src/graphql.test.ts @@ -2,12 +2,11 @@ import { buildHTTPExecutor } from '@graphql-tools/executor-http' import { expect, it } from 'bun:test' import { countries } from 'countries-list' import { parse } from 'graphql' - import { yoga } from './graphql' const executor = buildHTTPExecutor({ fetch: yoga.fetch, - endpoint: 'http://yoga/graphql', + endpoint: 'http://yoga/', }) const ListFilteredCountriesQuery = parse(/* GraphQL */ `