Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-09-2019 02:36 AM
Hello ,i want to merge two schema result for making nodes.Since graphql does not make the statement merge , i am trying this example...
type User {
id:ID!
User_ID:String!
Mobile_Number:String!
Name:String!
Email_Id:String!
Country_Id:String!
DOB:String!
Status:String!
Friends:[String!]!
settings:[Settings]
}
type Settings {
id:ID!
User_ID:String!
Auto_Check_In:String!
Notification:String!
Selected_Recommendation:String!
Status:String!
user:[User]
}
output-
{
"data": {
"users": [
{
"id": "0.55515894979673",
"User_ID": "2",
"Name": "kp",
"settings": null
}
]
}
}
i am expecting the value of settings should be merge in user data ..
Can anyone please guide me how to merge this two schema, or any other way to do so.
09-09-2019 03:32 PM
Hi @nikita.vhits -
The settings
field should represent a relationship connecting the User
and Settings
node. You'll want to use the @relation
schema directive in your type definitions to indicate the relationship:
settings: [Settings] @relation(name: "HAS_SETTINGS", direction: "OUT")
See the docs for more info: https://grandstack.io/docs/graphql-relationship-types.html#defining-relationships-in-sdl
09-10-2019 09:54 PM
Hii @William_Lyon
i had try this out but its show me error for Unknown directive "relation".Can u please tell me any other solution.
thanks
All the sessions of the conference are now available online