diff --git a/graphql/admin/schema.go b/graphql/admin/schema.go index 96f9fd5bac3..7e1c23448f6 100644 --- a/graphql/admin/schema.go +++ b/graphql/admin/schema.go @@ -57,10 +57,8 @@ func resolveUpdateGQLSchema(ctx context.Context, m schema.Mutation) (*resolve.Re if _, err = schema.FromString(schHandler.GQLSchema()); err != nil { return resolve.EmptyResult(m, err), false } - newGQLSchema := input.Set.Schema - newDgraphSchema := schHandler.DGSchema() - resp, err := edgraph.UpdateGQLSchema(ctx, newGQLSchema, newDgraphSchema) + resp, err := edgraph.UpdateGQLSchema(ctx, input.Set.Schema, schHandler.DGSchema()) if err != nil { return resolve.EmptyResult(m, err), false } @@ -70,8 +68,8 @@ func resolveUpdateGQLSchema(ctx context.Context, m schema.Mutation) (*resolve.Re m.Name(): map[string]interface{}{ "gqlSchema": map[string]interface{}{ "id": query.UidToHex(resp.Uid), - "schema": newGQLSchema, - "generatedSchema": newDgraphSchema, + "schema": input.Set.Schema, + "generatedSchema": schHandler.GQLSchema(), }}}, Field: m, Err: nil,