Making a neo4j api using graph ql

i made a neo4j graph database in the desktop application and now i want to make an api for the same data base. first i tried to use the graph ql toolbox extension on the desktop application and i got queries to work but i couldnt figure out how to do anything with like making an api and connecting it to our website. im now trying it in vscode by following this and this guide. im trying to use the introspect tool because my database is pretty big and i dont want to manually make each type and define its properties. i have no experience with apollo servers so i tried to follow the guide but its not working for me. here is the index.js file

import { startStandaloneServer } from '@apollo/server/standalone';
import { Neo4jGraphQL } from "@neo4j/graphql";
import { toGraphQLTypeDefs } from "@neo4j/introspector";
import neo4j from "neo4j-driver";

const driver = neo4j.driver(
    "neo4j://localhost:7687",
    neo4j.auth.basic("neo4j", "password")
);

const sessionFactory = () =>
    driver.session({ defaultAccessMode: neo4j.session.READ });

// We create a async function here until "top level await" has landed
// so we can use async/await
async function main() {
    const readonly = true; // We don't want to expose mutations in this case
    const typeDefs = await toGraphQLTypeDefs(sessionFactory, readonly);
    const driver = neo4j.driver(
        "bolt://localhost:7687",
        neo4j.auth.basic("neo4j", "password")
    );
    
    const neoSchema = new Neo4jGraphQL({ typeDefs, driver });

    const server = new ApolloServer({
        schema: await neoSchema.getSchema(),
    });
    
    const { url } = await startStandaloneServer(server, {
        context: async ({ req }) => ({ req }),
        listen: { port: 4000 },
    });
    
    console.log(`🚀 Server ready at ${url}`); 
}

main();

here is the output

Hey @kabsubstitute,

You are getting this error because you haven't imported the ApolloServer class.

import { ApolloServer } from '@apollo/server';

I noticed it isn't in the example on our Getting Started guide, did you copy and paste from there?

I would also suggest having a separate script for the introspection that saves the generated schema to a text file. The introspection may take a long time on a larger database, so you don't want to do it every time you start the server.

hey, thanks this helped get the server running but im still not able to run any queries as is get this error message :

also, could you please tell me how i can use a seperate script to for introspection? Say i only run the server on this file, i would still have to get the put the schema here, and if i introspect seperately how can use the txt as the schema if i need the server running for introspection? also, even if i were to get working queries, how would i use like, like if i want to display information from my database when the user clicks on a link in my website, how would i use "response" over there? thank you