File tree 1 file changed +8
-8
lines changed
src/code/language-support/javascript/server
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -17,17 +17,18 @@ Then run `node server.js` with this code in `server.js`:
17
17
``` js
18
18
import { ApolloServer } from " @apollo/server"
19
19
import { startStandaloneServer } from " @apollo/server/standalone"
20
- import { buildSchema } from " graphql"
21
20
22
- const schema = buildSchema (`
23
- type Query {
24
- hello: String
25
- }
26
- ` )
21
+ // The GraphQL schema
22
+ const typeDefs = ` #graphql
23
+ type Query {
24
+ hello: String
25
+ }
26
+ `
27
27
28
+ // A map of functions which return data for the schema.
28
29
const resolvers = {
29
30
Query: {
30
- hello : () => " Hello World! " ,
31
+ hello : () => " world " ,
31
32
},
32
33
}
33
34
@@ -37,7 +38,6 @@ const server = new ApolloServer({
37
38
})
38
39
39
40
const { url } = await startStandaloneServer (server)
40
-
41
41
console .log (` 🚀 Server ready at ${ url} ` )
42
42
```
43
43
You can’t perform that action at this time.
0 commit comments