diff options
| author | Fuwn <[email protected]> | 2024-09-28 16:40:08 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-09-28 16:40:12 -0700 |
| commit | 802dcc9f5a4b2f0824e2600cd080d33691056d16 (patch) | |
| tree | 23c194f2410e21009981a8e475e703bd210b5b4e /src/graphql/hello | |
| parent | feat(html): update analytics url (diff) | |
| download | due.moe-802dcc9f5a4b2f0824e2600cd080d33691056d16.tar.xz due.moe-802dcc9f5a4b2f0824e2600cd080d33691056d16.zip | |
feat(api): set up graphql api
Diffstat (limited to 'src/graphql/hello')
| -rw-r--r-- | src/graphql/hello/index.ts | 4 | ||||
| -rw-r--r-- | src/graphql/hello/resolvers.ts | 10 | ||||
| -rw-r--r-- | src/graphql/hello/schema.graphql | 3 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/graphql/hello/index.ts b/src/graphql/hello/index.ts new file mode 100644 index 00000000..925a7ece --- /dev/null +++ b/src/graphql/hello/index.ts @@ -0,0 +1,4 @@ +import typeDefs from './schema.graphql?raw'; +import { resolvers } from './resolvers'; + +export default { typeDefs, resolvers }; diff --git a/src/graphql/hello/resolvers.ts b/src/graphql/hello/resolvers.ts new file mode 100644 index 00000000..f882765f --- /dev/null +++ b/src/graphql/hello/resolvers.ts @@ -0,0 +1,10 @@ +import type { WithIndex } from '../$types'; +import type { Resolvers } from './$types'; + +export const resolvers: WithIndex<Resolvers> = { + Query: { + hello() { + return 'Hello SvelteKit!'; + } + } +}; diff --git a/src/graphql/hello/schema.graphql b/src/graphql/hello/schema.graphql new file mode 100644 index 00000000..d3dba234 --- /dev/null +++ b/src/graphql/hello/schema.graphql @@ -0,0 +1,3 @@ +type Query { + hello: String! +} |