File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,43 @@ app.listen({ port: 4000 }, () =>
320
320
321
321
Apollo Server also supports all Node.js HTTP server frameworks: Express, Connect, HAPI, Koa and NestJs.
322
322
323
+ #### [ graphql-yoga] ( https://github.com/prisma-labs/graphql-yoga ) ([ github] ( https://github.com/apollographql/apollo-server ) ) ([ npm] ( https://www.npmjs.com/package/graphql-yoga ) )
324
+
325
+ Fully-featured GraphQL Server with focus on easy setup, performance & great developer experience
326
+
327
+ - Sensible defaults & includes everything you need with minimal setup.
328
+ - Built-in support for GraphQL subscriptions using WebSockets.
329
+ - Works with all GraphQL clients (Apollo, Relay...) and fits seamless in your GraphQL workflow.
330
+
331
+ To run a hello world server with graphql-yoga:
332
+
333
+ ``` bash
334
+ npm install graphql-yoga
335
+ ```
336
+
337
+ Then run ` node server.js ` with this code in ` server.js ` :
338
+
339
+ ``` js
340
+ import { GraphQLServer } from ' graphql-yoga'
341
+ // ... or using "require()"
342
+ // const { GraphQLServer } = require('graphql-yoga')
343
+
344
+ const typeDefs = `
345
+ type Query {
346
+ hello(name: String): String!
347
+ }
348
+ ` ;
349
+
350
+ const resolvers = {
351
+ Query: {
352
+ hello : (_ , { name }) => ` Hello \$ {name || 'World'}` ,
353
+ },
354
+ };
355
+
356
+ const server = new GraphQLServer ({ typeDefs, resolvers })
357
+ server .start (() => console .log (' Server is running on localhost:4000' ))
358
+ ```
359
+
323
360
### Kotlin
324
361
325
362
- [ graphql-kotlin] ( https://github.com/ExpediaGroup/graphql-kotlin/ ) : A set of libraries for running GraphQL server in Kotlin.
You can’t perform that action at this time.
0 commit comments