I have a question about how to use variables in a fhir graphql request. I’ve gotten the below request to work if I hardcode the patient id, but I’m not sure how to get it working with a variable.
This is what I have so far.
This is the query.
query($patient: ID){
CoverageList(patient: $patient) {
subscriberId
period {
start
end
}
extension @flatten{
valueReference @flatten{
resource {
…on InsurancePlan {
name
}
}
}
}
}
}
This is the variable I’m trying to get working.
{
“patient”: “10b8ed43-fa0a-4a3c-87bc-f1bd032309af”
}
I haven’t found anything in the graphql schema or the HL7 FHIR documentation that answers how to do this.