Answers for "apollo server"

3

setup apollo server express

npm install apollo-server-express

# yarn
yarn add apollo-server-express


# server.js
import express from 'express';
import bodyParser from 'body-parser';
import { graphqlExpress } from 'apollo-server-express';

const myGraphQLSchema = // ... define or import your schema here!
const PORT = 3000;

const app = express();

// bodyParser is needed just for POST.
app.use('/graphql', bodyParser.json(), graphqlExpress({ schema: myGraphQLSchema }));

app.listen(PORT);
Posted by: Guest on August-25-2020
0

install apollo server

npm install apollo-server graphql

# yarn 
yarn add apollo-server graphql
Posted by: Guest on August-25-2020
1

apollo server

npm install apollo-server graphql
Posted by: Guest on September-04-2020

Code answers related to "apollo server"

Browse Popular Code Answers by Language