export const typeDefs = `
type University {
id: ID!
level: Int
}
type Department {
id: ID!
name: String
level: Int
has: [Position] @relation(name: "HAS", direction: "OUT")
childsof: [Department] @relation(name: "CHILD_OF", direction: "IN")
}
type Position {
id: ID!
name: String
level: Int
type: String
}
type Query {
universities(id: ID, level: Int, first: Int = 10, offset: Int = 0): [University]
departments(id: ID, name: String, level: Int, first: Int = 10, offset: Int = 0): [Department]
positions(id: ID, name: String, level: Int, type: String, first: Int = 10, offset: Int = 0): [Position]
}
Here's the schema of my application. I want my :Department node to have a relationship of 'CHILD_OF' i.e. in Cypher this is what I want - a1:Department -[:CHILD_OF]-> a2:Department
but I' m unable to do so.
Can anyone tell me how it's done using neo4j-graphql-js
The graphQL generated a mutation based on the relationship given above. For the department's child of relationship it has created an addChildOf but the parameter it is giving is only one and it's of department.