Skip to content

Commit c9d2fb1

Browse files
committed
apollo updated from v2 to v3
1 parent 864e027 commit c9d2fb1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@
127127
"homepage": "https://github.com/open-source-labs/ReacType#readme",
128128
"dependencies": {
129129
"@apollo/client": "^3.6.9",
130-
"@apollo/federation": "^0.28.0",
131130
"@babel/cli": "^7.18.10",
132131
"@babel/register": "^7.18.9",
132+
"@graphql-tools/schema": "^9.0.17",
133133
"@mui/icons-material": "^5.8.4",
134134
"@mui/lab": "^5.0.0-alpha.93",
135135
"@mui/styles": "^5.11.12",
@@ -140,7 +140,7 @@
140140
"@types/react-redux": "^7.1.24",
141141
"@types/react-router-dom": "^5.3.3",
142142
"ace-builds": "^1.8.1",
143-
"apollo-server": "^2.0.0",
143+
"apollo-server": "^3.0.0",
144144
"apollo-server-core": "^3.12.0",
145145
"apollo-server-express": "^3.12.0",
146146
"app-root-path": "^3.0.0",
@@ -203,7 +203,7 @@
203203
"@types/jest": "^28.1.6",
204204
"@typescript-eslint/eslint-plugin": "^5.35.1",
205205
"@typescript-eslint/parser": "^5.35.1",
206-
"apollo": "^2.11.1",
206+
"apollo": "^2.34.0",
207207
"axios": "^0.27.2",
208208
"babel-eslint": "^10.1.0",
209209
"babel-jest": "^28.1.3",

server/server.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { ApolloServer } = require('apollo-server-express');
2+
const {makeExecutableSchema} = require('@graphql-tools/schema');
23
const express = require('express');
34
const cookieParser = require('cookie-parser');
45
//const passport = require('passport');
@@ -126,7 +127,10 @@ const { dirname } = require('node:path');
126127

127128
// instantiate Apollo server and attach to Express server, mounted at 'http://localhost:PORT/graphql'
128129

129-
const server = new ApolloServer({ typeDefs, resolvers });
130+
//use make exacutable schema to allow schema to be passed to new server
131+
const schema = makeExecutableSchema({typeDefs, resolvers});
132+
133+
const server = new ApolloServer({schema});
130134
(async function() {
131135
await server.start()
132136
server.applyMiddleware({ app, path: '/graphql' });

0 commit comments

Comments
 (0)