init
This commit is contained in:
commit
f8a16a9fce
8 changed files with 95 additions and 0 deletions
8
src/index.ts
Normal file
8
src/index.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { createYoga } from "graphql-yoga";
|
||||
import { schema } from "./schema";
|
||||
|
||||
const yoga = createYoga({ schema });
|
||||
|
||||
const server = Bun.serve({ fetch: yoga.fetch });
|
||||
|
||||
console.log(`Server is running on: ${server.url}${yoga.graphqlEndpoint}`);
|
||||
13
src/schema.ts
Normal file
13
src/schema.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import SchemaBuilder from "@pothos/core";
|
||||
|
||||
const builder = new SchemaBuilder({});
|
||||
|
||||
builder.queryType({
|
||||
fields: (t) => ({
|
||||
hello: t.string({
|
||||
resolve: () => "world",
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
export const schema = builder.toSchema();
|
||||
Loading…
Add table
Add a link
Reference in a new issue