SLB-426: GraphQL Build entity update #1535
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Package(s) involved
silverback_gatsby
Description of changes
Once the GraphQL Build entity is saved at /admin/config/graphql/servers/build/silverback_gatsby for example (let's say the Notification user gets updated), a second update operation is not possible because the buildEntity() method of the Build entity class uses "+" to append data into the configuration entity. But the "+" operation would not overwrite existing data. One solution (which has been implemented) is to use array_merge. Another one would be to use the "+", but in a different way, something like:
$entity->schema_configuration[$entity->schema] = $form_state->getValue('schema_configuration')[$entity->schema] + $entity->schema_configuration[$entity->schema]
Related Issue(s)
GraphQL Server Build entities cannot be updated
How has this been tested?
Locally, manually.