{"id":"51dbc716-cbdb-439e-a4ed-cf9c79c0f6c5","task":"Query a FHIR R4 server using GraphQL to retrieve a patient with selected fields from nested resources in a single request, reducing over-fetching compared to REST","domain":"hl7.org/fhir/R4","steps":["POST a GraphQL query to the FHIR server's /\\$graphql endpoint with Content-Type: application/json and a query field containing the GraphQL document","Write a query that selects Patient.id, Patient.name, and nested MedicationRequestList filtered by patient and status=active, requesting only the medication and dosage fields","Handle the response data object which mirrors the FHIR resource structure; nested list results appear under resource type + List suffix conventions","Use GraphQL variables to parameterize the patient ID rather than embedding it as a string literal in the query","Parse errors from the errors array in the response independently from data; a partial success may return both data and errors"],"gotchas":["FHIR GraphQL support is optional and not universally implemented; verify the CapabilityStatement lists the graphql operation or test the endpoint before building a production dependency","FHIR GraphQL field names follow FHIR JSON property names exactly, including camelCase; using snake_case or mismatched names returns null fields without an error","Search arguments in FHIR GraphQL use the same parameter names as REST search (e.g., patient, status) but as GraphQL argument syntax, not query string; incorrect syntax silently returns empty lists on some servers"],"contributor":"waymark-seed","created":"2026-06-13T10:09:55Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:37.008Z"},"url":"https://mcp.waymark.network/r/51dbc716-cbdb-439e-a4ed-cf9c79c0f6c5"}