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(GraphQL):This PR will fix the graphl tests that were failing because of recent change in dgraph. #7329

Merged
merged 7 commits into from
Jan 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions graphql/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ func (g *GraphQLHealthStore) updatingSchema() {
type gqlSchema struct {
ID string `json:"id,omitempty"`
Schema string `json:"schema,omitempty"`
Version uint64
GeneratedSchema string
}

Expand Down Expand Up @@ -530,12 +531,13 @@ func newAdminResolver(
}

newSchema := &gqlSchema{
ID: query.UidToHex(pk.Uid),
Schema: string(pl.Postings[0].Value),
ID: query.UidToHex(pk.Uid),
Version: kv.GetVersion(),
Schema: string(pl.Postings[0].Value),
}
server.mux.RLock()
if newSchema.Schema == server.schema.Schema {
glog.Infof("Skipping GraphQL schema update as the new schema is the same as the current schema.")
if newSchema.Version <= server.schema.Version || newSchema.Schema == server.schema.Schema {
glog.Infof("Skipping GraphQL schema update, new badger key version is %d, the old version was %d.", newSchema.Version, server.schema.Version)
server.mux.RUnlock()
return
}
Expand Down