Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL Mutation not working #3905

Closed
fh-rranjan opened this issue Feb 8, 2024 · 2 comments · Fixed by #4319
Closed

GraphQL Mutation not working #3905

fh-rranjan opened this issue Feb 8, 2024 · 2 comments · Fixed by #4319

Comments

@fh-rranjan
Copy link

On our hosted medplum server (version 3.0.2-c34ad9a1).
I tried to run mutation query PatientUpdate on Medplum graphQL playground, It's sending null value in response and data is not getting updated on medplum dashboard.
Query:

mutation PatientUpdate {
  PatientUpdate(
    id: "b92cfbe5-0a18-42db-bba3-0ceaca8e81ef"
    res: {
      resourceType: "Patient",
      name: [{given: "Homer"}]
    }
  ) {
    id
    name {
      given
    }
  }
}

Response:

{
  "data": {
    "PatientUpdate": {
      "id": null,
      "name": null
    }
  }
}
@fh-rranjan
Copy link
Author

Hi

Can anyone help me out in this?
Do you required some more details to resolve this?
Please let me know if any.
Please try to resolve this as soon as possible. I'm stuck here.

Thanks

@codyebberson codyebberson added this to the April 30th, 2024 milestone Apr 2, 2024
@codyebberson
Copy link
Member

codyebberson commented Apr 3, 2024

Hi @fh-rranjan -

There are two immediate issues:

  1. An update operation requires id to be duplicated in the body (sorry, I know that's weird, but that's the FHIR GraphQL spec)
  2. You're passing Patient.name.given as a string, when it should be an array of strings.
    • name: [{given: "Homer"}] should be name: [{given: ["Homer"]}]

There is a separate issue, which is that the error is not correctly returned for mutations. We're working on a fix now. Thank you for reporting.

medplumbot added a commit that referenced this issue Apr 4, 2024
Added sortStringArray utility function (#4297)Remove 'dist' from eligibility demo (#4300)
Fixes #3944 - patient everything pagination (#4296)
Fixed fragment with only one child warning (#4306)
Fixes #4299 - use correct cardinality on contentReference (#4304)
Add "New..." action in Medplum Provider app (#4303)
Updating case study material (#4305)
Drop unused columns from lookup tables (#4294)
Fixes #3905 - better graphql mutation error reporting (#4308)
Fixes #4309 - AWS Parameter Store support for required database SSL (#4310)
codyebberson pushed a commit that referenced this issue Apr 4, 2024
Added sortStringArray utility function (#4297)Remove 'dist' from eligibility demo (#4300)
Fixes #3944 - patient everything pagination (#4296)
Fixed fragment with only one child warning (#4306)
Fixes #4299 - use correct cardinality on contentReference (#4304)
Add "New..." action in Medplum Provider app (#4303)
Updating case study material (#4305)
Drop unused columns from lookup tables (#4294)
Fixes #3905 - better graphql mutation error reporting (#4308)
Fixes #4309 - AWS Parameter Store support for required database SSL (#4310)
github-merge-queue bot pushed a commit that referenced this issue Apr 5, 2024
Added sortStringArray utility function (#4297)Remove 'dist' from eligibility demo (#4300)
Fixes #3944 - patient everything pagination (#4296)
Fixed fragment with only one child warning (#4306)
Fixes #4299 - use correct cardinality on contentReference (#4304)
Add "New..." action in Medplum Provider app (#4303)
Updating case study material (#4305)
Drop unused columns from lookup tables (#4294)
Fixes #3905 - better graphql mutation error reporting (#4308)
Fixes #4309 - AWS Parameter Store support for required database SSL (#4310)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants