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

fix(ra-data-graphql-simple): Unify meta location in buildVariables #10322

Merged

Conversation

dricholm
Copy link
Contributor

Problem

Fixes #10317.
The sparse fields functionality works by reading the meta.sparseFields array. But for create and update mutations it looked for the sparseFields value in data.meta.

Solution

Return the meta object in buildCreateUpdateVariables which is used for both create and update mutations.

How To Test

Can be tested by setting the meta object for a create or update mutation and setting sparse fields on it:

{
  meta: { sparseFields: ['id'] }
}

Trigger the mutation and the generated selection should only include fields specified in sparseFields.

Additional Checks

  • The PR targets master for a bugfix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
    • Not UI related, affects data provider. I'm not aware that it has any stories.
  • The documentation is up to date

Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@djhi djhi added this to the 5.3.3 milestone Nov 8, 2024
@djhi djhi merged commit dac5101 into marmelab:master Nov 8, 2024
14 checks passed
@dricholm dricholm deleted the ra-data-graphql-simple-variables-meta branch November 8, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sparse Field and meta handling different for create/update
2 participants