lewisedc
02/25/2019, 11:44 AM@relation(name: "OldRelation")
Jenkins
02/25/2019, 11:47 AMtype User {
id: ID!
name: String!
posts: [Post!]!
}
type Post {
id: ID!
title: String!
postedBy: User!
}
then you can add @relation(name: "SomeName")
and that becomes the name of their relation.
The final SDL would look like this:
type User {
id: ID!
name: String!
posts: [Post!]! @relation(name: "UserPosts")
}
type Post {
id: ID!
title: String!
postedBy: User! @relation(name: "UserPosts")
}
lewisedc
02/25/2019, 11:52 AMJenkins
02/25/2019, 12:05 PM