How to generate typeDefs from existing Neo4J database with help of some tool or some mean?

I want to use Neo4jGraphQL library and have one existing Neo4J database. Is there a way to generate typeDefs out of the box using using some tool or some mean?

const { Neo4jGraphQL } = require("@neo4j/graphql");

const neo4j = require("neo4j-driver");

const typeDefs = gql`

type User {

username: String

orders: [Order!]! @relationship(type: "PLACED", direction: OUT)

}

The older neo4j-graphql-js had an automatic schema generation feature, but it hasn't been included in @neo4j/graphql yet.

In the meantime, what you can do in your Neo4j instance is run these two queries:

CALL apoc.meta.nodeTypeProperties();
CALL apoc.meta.relTypeProperties();

These will give you complete reports of all of the metadata in the database. It isn't a GraphQL set of typedefs, but you can translate it into typedefs. (This is how the feature in neo4j-graphql-js worked)

1 Like

Thank you very much David.