Schema:
type TrackUser {
id: ID! @unique
createdAt: DateTime!
user: User #note there is no `!`
}
type User {
id: ID! @unique
name: String! @unique
}
I want to get Alls TrackUser
where User
is not null. What would be the query?
This would be a possible query:
query c {
trackUsers(where: { NOT: [{ user: null }] }) {
name
}
}
Here you can see how it looks in the Playground. I added a name to Trackuser in the datamodel in order to be able to create it from that side without a user.