File tree 2 files changed +10
-10
lines changed
examples/api-routes-graphql
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 6
6
"start" : " next start"
7
7
},
8
8
"dependencies" : {
9
- "@ graphql-yoga/node " : " ^2.11.2 " ,
9
+ "graphql-yoga" : " three " ,
10
10
"graphql" : " ^16.5.0" ,
11
11
"next" : " latest" ,
12
12
"react" : " ^18.2.0" ,
Original file line number Diff line number Diff line change 1
- import { createServer } from '@ graphql-yoga/node '
1
+ import { createYoga , createSchema } from 'graphql-yoga'
2
2
3
3
const typeDefs = /* GraphQL */ `
4
4
type Query {
@@ -17,13 +17,13 @@ const resolvers = {
17
17
} ,
18
18
}
19
19
20
- const server = createServer ( {
21
- schema : {
22
- typeDefs,
23
- resolvers,
24
- } ,
25
- endpoint : '/api/graphql' ,
26
- // graphiql: false // uncomment to disable GraphiQL
20
+ const schema = createSchema ( {
21
+ typeDefs,
22
+ resolvers,
27
23
} )
28
24
29
- export default server
25
+ export default createYoga ( {
26
+ schema,
27
+ // Needed to be defined explicitly because our endpoint lives at a different path other than `/graphql`
28
+ graphqlEndpoint : '/api/graphql' ,
29
+ } )
You can’t perform that action at this time.
0 commit comments