Skip to content

Conversation

@cwangsmv
Copy link
Contributor

@cwangsmv cwangsmv commented Sep 27, 2024

Background
Currently, When we add a new property to models like Request, we will add the default value of this property in model init method. Otherwise the new property can not be updated due to current design in database.update method which will check if updated keys is valid.

But this will cause all existing models show as modified in git sync, due to current implementation of using YAML stringify method to compare local db content with git origin content. The YAML stringify method will add a new property to the yaml file even the value is undefined.

Solution
Instead of adding a new property to request, I have moved the logic to detect if a GraphQL request operation is subscription or not into request model, so no more extra property is needed

@cwangsmv cwangsmv requested a review from gatzjames September 27, 2024 10:25
@notjaywu notjaywu requested a review from ihexxa September 29, 2024 02:54
ihexxa
ihexxa previously approved these changes Sep 29, 2024
@cwangsmv cwangsmv force-pushed the fix/remove-extra-field-in-response branch from 10236a4 to ac6f11b Compare September 29, 2024 07:36
@cwangsmv cwangsmv enabled auto-merge (squash) September 29, 2024 07:36
@cwangsmv cwangsmv merged commit 01402b5 into develop Sep 29, 2024
@cwangsmv cwangsmv deleted the fix/remove-extra-field-in-response branch September 29, 2024 07:47
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.

2 participants