paljs/prisma-tools

PrismaSelect not working for deeply nested queries

baileygranam opened this issue · 0 comments

I have the following query:

query($filters: GetAppointmentsFilterInput!) {
  getAppointments(filters: $filters) {
    id
    notes
    internalNotes
    status
    user {
      business {
        id
        name
      }
      company {
        id
        alias
        users {
          id
          firstName
        }
      }
    }
  }
}

However, when running PrismaSelect on this example it is only returning:

{
  "select": {
    "id": true,
    "notes": true,
    "internalNotes": true,
    "user": {
      "select": {
        "business": {
          "select": {
            "id": true,
            "name": true
          }
        },
        "company": {
          "select": {
            "id": true,
            "alias": true
          }
        }
      }
    }
  }
}

Which is resulting in an error: Cannot return null for non-nullable field Company.users.