-1

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.

asked Jun 24 at 20:07
2
  • 2
    "phone and emailAddress object come back null": that's a function of your backend code that's responding to the query. The query itself from what I can see is fine. Can you edit the question to include a minimal reproducible example, especially describing what the relevant server code looks like? Commented Jun 24 at 20:34
  • 1
    "they don't seem to know whose phone and email to look up" - not clear why that is, they are fields of a Person (assuming that's the type the person field returns), so surely they should look up the phone and email of that respective person? It should not matter that personRoles returns 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? Commented Jun 25 at 0:29

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.