``` type User @model { id: ID! @unique nam...
# orm-help
i
Copy code
type User @model {
    id: ID! @unique
    name: String!
    dashboard: Dashboard @relation(name: "UserDashboard" onDelete: CASCADE)
}

type Dashboard @model {
    id: ID! @unique
    user: User! @relation(name: "UserDashboard")
    charts: [Chart!]! @relation(name: "DashboardCharts" onDelete: CASCADE)
}
How do I make a query that fetches a dashboard by userId ?
I have a dashboard query with a DashboardUniqueWhereInput but that's just the ID
I have this query but it's the other way
Copy code
query getUserWithDashboardWithChartsWithMarket($userId: ID!) {
    user(where: { id: $userId }) {
      id
      name
      dashboard {
h
{ dashboard(where: { user: {id: ""}}){id}}
i
ah, you can nest it inside there. okay
Copy code
Argument 'where' expected type 'DashboardWhereUniqueInput!' but got: {user: {id: \"cjnj6iu8u04lg0a838n9wy734\"}}. Reason: 'user' Field 'user' is not defined in the input type 'DashboardWhereUniqueInput'. (line 2, column 20):\n  dashboard(where: {user: {id: \"cjnj6iu8u04lg0a838n9wy734\"}}) {\n                   ^\n (line 2, column 21):\n  dashboard(where: {user: {id: \"cjnj6iu8u04lg0a838n9wy734\"}}) {\n                    ^
h
So query dashboards and return first item from array. I forgot s in first query