paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
687 stars 55 forks source link

PrismaSelect not working for deeply nested queries #263

Closed baileygranam closed 2 years ago

baileygranam commented 2 years ago

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.