Skip to content

Commit b709150

Browse files
omairvaiyanidouglasmuraoka
authored andcommitted
fix(GraphQL): Mutations not returning updated information (#6130)
This issue was spotted when an updated field is modified in beforeSave, but the unmodified version is returned if requested by the resolver. For example ```graphql mutation UpdateTitle($id: ID!, $title: String!) { updateSomeObject(id: $id, fields: { title: $title }) { id title slug } } ``` In the above, if we modify the `title` by let's say, trimming it - the resolved `title` will not reflect this change, and instead just return the input variable. Other resolved fields that are not sent within the `fields` input are returned properly using the latest data.
1 parent 44c77fa commit b709150

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GraphQL/loaders/parseClassMutations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const getOnlyRequiredFields = (
2222
const missingFields = selectedFields
2323
.filter(
2424
field =>
25-
(!updatedFields[field] && !nativeObjectFields.includes(field)) ||
25+
!nativeObjectFields.includes(field) ||
2626
includedFields.includes(field)
2727
)
2828
.join(',');

0 commit comments

Comments
 (0)