Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-27-2018 07:37 AM
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.
Solved! Go to Solution.
04-24-2019 01:48 AM
08-29-2018 12:28 PM
You can add auto-generated mutations to your schema by calling augmentSchema
, passing in your schema object. Here's an example: https://github.com/neo4j-graphql/neo4j-graphql-js/blob/master/example/apollo-server/movies-middlewar...
09-03-2018 07:54 PM
Hey William,
Sorry for late reply but the solution you're proposing is already been done.
You can take a look at the code @ https://github.com/thepiperpied/palm-tree
04-24-2019 01:48 AM
All the sessions of the conference are now available online