lightning web components – Help writing a complex graphql query

I am trying to write a query to grab Events relating to the a meeting__c record. There is an OR clause which basiacally checks:

  • If the What.Name is LIKE “%searchString” OR
  • If WhatId is IN:

(SELECT Account__c FROM Meeting__c WHERE Id = meetingId)

    @wire(graphql, {
    query: gql`
        query relatedEvents($meetingId: ID!, $searchString: String) {
            uiapi {
                query {
                    Event(
                        where: {
                            or: 
                            [{
                                What: { Account: { Name: { like: $searchString } } },
                                WhatId: { inq: { Meeting__c: {Id: { eq: $meetingId } }, ApiName:"Account__c" }}
                            }]
                        }
                    ) {
                        edges {
                            node {
                                Id 
                                Subject { value } 
                                OwnerId { value } 
                                StartDateTime { value } 
                                What {
                                ... on Event { 
                                    Name { value }
                                }
                            }
                        }
                    }
                }
            }
        }
    `,
    relatedEventsVars: "$relatedEventsVars"
})

However, this crashes the page and after different tries, still no luck. Any idea what i’m doing wrong?

Read more here: Source link