-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgraphql.ts
39 lines (37 loc) · 922 Bytes
/
graphql.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { useGenerateGQty } from "@gqty/cli/envelop";
import { CreateApp, gql } from "@graphql-ez/nextjs";
import { ezCodegen } from "@graphql-ez/plugin-codegen";
import { ezGraphiQLIDE } from "@graphql-ez/plugin-graphiql";
import { ezSchema } from "@graphql-ez/plugin-schema";
const { buildApp } = CreateApp({
ez: {
plugins: [
ezCodegen({
outputSchema: true,
}),
ezGraphiQLIDE({
defaultQuery: "query { hello }",
}),
ezSchema({
schema: {
typeDefs: gql`
type Query {
hello: String!
}
`,
resolvers: {
Query: {
hello() {
return "Hello World";
},
},
},
},
}),
],
},
envelop: {
plugins: [useGenerateGQty()],
},
});
export default buildApp().apiHandler;