fix(GraphQL):This PR will fix the graphl tests that were failing because of recent change in dgraph. #7329
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.
we have changed in Dgraph the way rollups are done in this PR. #7253
As a result of it, we were having below unexpected behavior in graphql while updating the schema.
issue:
suppose we send below schema requests,
Badger is supposed to return the following updates to graphql
1.schema1
1.schema1
1.schema1
2.schema2
2.schema2
2.schema2
If we get a schema update that is same as our previous schema then we are already ignoring that
in graphql.For example, below multiple updates for schema1,schema2 from badger gets ignored
But because of the recent change we are now sometimes getting older updates in random order like below.
so in this case graphql was assuming that we got an new schema which actually was old schema.
And due to that multiple errors were broken.
Solution
The solution is simple.Every update from the badger also have version associated to it.
And that version number is strictly increasing. Now, if we get an schema with version <= current schema version
then we don't update the graphql schema.And that solve the issue
This change is