This commit is contained in:
Benjamin Palko 2024-12-10 09:49:59 -05:00
parent 05faa76d7d
commit b10cb37549
3 changed files with 26 additions and 0 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -49,6 +49,8 @@
}, },
"dependencies": { "dependencies": {
"@tailwindcss/typography": "^0.5.15", "@tailwindcss/typography": "^0.5.15",
"graphql": "^16.9.0",
"graphql-yoga": "^5.10.4",
"storybook-dark-mode": "^4.0.2" "storybook-dark-mode": "^4.0.2"
} }
} }

View file

@ -0,0 +1,24 @@
import { createSchema, createYoga } from 'graphql-yoga';
import type { RequestEvent } from '@sveltejs/kit';
const yogaApp = createYoga<RequestEvent>({
schema: createSchema({
typeDefs: `
type Query {
hello: String
}
`,
resolvers: {
Query: {
hello: () => 'SvelteKit - GraphQL Yoga'
}
}
}),
// Needed to be defined explicitly because our endpoint lives at a different path other than `/graphql`
graphqlEndpoint: '/api/graphql',
// Needed to let Yoga use sveltekit's Response object
fetchAPI: { Response }
});
export { yogaApp as GET, yogaApp as POST };