@PaulContremoulin removing the "graphql" dependency fixed this issue for me. here is my package.json:
"dependencies": {
"apollo-server": "^2.19.0",
"apollo-server-express": "^2.19.0",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"neo4j-driver": "^4.2.0-alpha01",
"neo4j-graphql-js": "^2.17.1"
},
and my index.js (note: im using firebase functions to serve the graphql endpoint and apollo studio for graph versioning and additional documentation)
edit: not sure why i have express in there twice, i'll take a look at that in a second.
const functions = require("firebase-functions")
const express = require("express")
const { makeAugmentedSchema } = require("neo4j-graphql-js")
const { ApolloServer } = require("apollo-server-express")
const neo4j = require("neo4j-driver")
const fs = require("fs")
const dotenv = require("dotenv")
const path = require("path")
dotenv.config()
const { NEO4J_URI, NEO4J_USER, NEO4J_PASSWORD, PORT, APOLLO_KEY } = process.env
// Load GraphQL type definitions from schema.graphql file
const typeDefs = fs
.readFileSync(path.join(__dirname, "schema.graphql"))
.toString("utf-8")
const schema = makeAugmentedSchema({
typeDefs,
})
const loggingConfig = { logging: neo4j.logging.console("debug") }
// Create Neo4j driver instance
const driver = neo4j.driver(
NEO4J_URI,
neo4j.auth.basic(NEO4J_USER, NEO4J_PASSWORD),
loggingConfig,
)
const server = new ApolloServer({
context: { driver },
schema,
introspection: true,
playground: true,
engine: {
reportSchema: true,
graphVariant: "development",
},
})
const app = express()
server.applyMiddleware({ app, path: "/", cors: true }) //
exports.api = functions.https.onRequest(app)
i hope this helps someone.