microsoft/Graphir

When we have a reference in a resource which can be more than one type of resource...

Closed this issue · 3 comments

When we have a reference in a resource which can be more than one type of resource, How we can define the return type in the resolver since we do not know it can be a reference to any type of them

image

For example, in Appointment Resource, we have a participant field which can be
"Patient", "Practitioner", "PractitionerRole", "RelatedPerson", "Device", "HealthcareService", "Location"

image

How to define the return type of the resolver in such scenarios?

The ResourceReference coming from FHIR may contain a type property. In which case the referenced resource must resolve to that type. Otherwise, the type can be inferred from the relative URL of the reference property.

see: ResourceReference

This issue is addressed and resolved by #59

Sample of reference schema object using UnionType
image
image
Sample query using reference type:
image

image