What does this piece of code do? ```@relation(name...
# orm-help
l
What does this piece of code do?
Copy code
@relation(name: "OldRelation")
j
If you have an SDL like this:
Copy code
type 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:
Copy code
type User {
  id: ID!
  name: String!
  posts: [Post!]! @relation(name: "UserPosts")
}

type Post {
  id: ID!
  title: String!
  postedBy: User! @relation(name: "UserPosts")
}
l
Thank you, so the only importance of the naming is that it matches the other place the relationship takes place
j
Yup - that's about it!