Closed cptflammin closed 1 year ago
Many thanks for raising this bug report @cptflammin. :bug: We will now attempt to reproduce the bug based on the steps you have provided.
Please ensure that you've provided the necessary information for a minimal reproduction, including but not limited to:
If you have a support agreement with Neo4j, please link this GitHub issue to a new or existing Zendesk ticket.
Thanks again! :pray:
Many thanks for raising this bug report @cptflammin. :bug: We will now attempt to reproduce the bug based on the steps you have provided.
Please ensure that you've provided the necessary information for a minimal reproduction, including but not limited to:
If you have a support agreement with Neo4j, please link this GitHub issue to a new or existing Zendesk ticket.
Thanks again! :pray:
@johnymontana Following the Neo4j YT channel, you may be the right the person to provide informed feedback :)
Hi @cptflammin, here's an example of @neo4j/graphql being used with Apollo Server v4 and Next.js so it should be helpful as to how to create serverless functions: https://github.com/vercel/next.js/tree/canary/examples/with-apollo-neo4j-graphql
In general though, if you follow the V4 getting started docs, it isn't too dissimilar to V3.
A small example using V4 with our library:
...
import { ApolloServer } from "@apollo/server";
import { startStandaloneServer } from "@apollo/server/standalone";
...
const neoSchema = new Neo4jGraphQL({
typeDefs: typeDefs,
driver,
});
const schema = await neoSchema.getSchema();
const server = new ApolloServer({ schema });
const { url } = await startStandaloneServer(server, {
listen: { port: 4000 },
});
console.log(`Online at ${url}`);
As @mjfwebb has pointed out, you need to call getSchema()
on the library to get the actual schema! Closing this one, you can ask for this kind of help in our #graphql
channel in Discord.
When using Neo4GraphQl with Apolloserver v4, a Typescript error is raised. Side note, https://neo4j.com/docs/graphql-manual/current/getting-started/ should be updated to latest version of Apollo v4, as v2 and v3 are now deprecated (EOL Oct 2023) By the way, we miss examples to properly setup a graphql server with NeoGraphQL API in both serverless and non-serverless environments, that would be helpful
Code:
Packages versions: graphapi@1.0.0 /Users/wtf/Development/myApp/graphAPI ├── @apollo/server@4.5.0 ├── @as-integrations/aws-lambda@2.0.1 ├── @neo4j/graphql-ogm@3.17.1 ├── @neo4j/graphql@3.17.1 ├── graphql@16.6.0 ├── neo4j-driver@5.6.0 └── typescript@4.9.5