In Laravel Lighthouse GraphQL, how can you retrieve the information from an intermediate "pivot" table?
Suppose I have Users and Roles in a belongsToMany relation:
type User {
roles: [Role!]! @belongsToMany
}
type Role {
users: [User!]! @belongsToMany
}
type Query {
user(id: ID! @eq): User @find
role(id: ID! @eq): Role @find
}
And also suppose that the intermediate table User_Role
contains columns "created_at" and "tag_id".
How would I go about to include the "created_at" in my query?
How would I get the tag that the tag_id
refers to?