I have the following structure
query GetOrganizationWithPersonData($orgNumbers: core_OrgNumbersArgs){
core{
organizations(orgNumbers: $orgNumbers){
personRoles{
person{
personNumber
phones{
personNumber
phoneSequence
}
emailAddresses {
personNumber
emailAddr
}
}
}
}
}
}
There are more field in the real one but my issue is since personRoles is a list of people and their roles in the org the phone and emailAddresses object come back null because they don't seem to know whose phone and email to look up. Is it possible to get this all in one query by passing in the personNumber so it knows what to look up or is this a multi query to get all the info and composite it together at the end? I tried in the Apollo sandbox to get some thing that can get the phones and it never seems to work. Phones and EmailAddresses accept a personNumber argument, but it won't take them as part of the larger query.
Further note, me playing around in Apollo is to figure out what the query format should be as it will in reality be sent in code as a query api request.
Person(assuming that's the type thepersonfield returns), so surely they should look up the phone and email of that respective person? It should not matter thatpersonRolesreturns a list. Why do you say that "Phones and EmailAddresses accept a personNumber argument"? This is weird. Can you please edit your question to include the relevant parts of the schema, not just the query?