From 401e052e20b44728ee2be37d14291fdc211a6527 Mon Sep 17 00:00:00 2001 From: Abhimanyu Singh Gaur <12651351+abhimanyusinghgaur@users.noreply.github.com> Date: Tue, 12 May 2020 17:08:04 +0530 Subject: [PATCH] graphql: report all errors during schema update (#5425) This PR makes sure that all schema related errors are reported during schema update. Fixes #GRAPHQL-455 --- graphql/admin/schema.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/graphql/admin/schema.go b/graphql/admin/schema.go index ef45544b69b..817d1c5c0e7 100644 --- a/graphql/admin/schema.go +++ b/graphql/admin/schema.go @@ -72,6 +72,10 @@ func (asr *updateSchemaResolver) Rewrite( if err != nil { return nil, err } + _, err = schema.FromString(schHandler.GQLSchema()) + if err != nil { + return nil, err + } asr.newDgraphSchema = schHandler.DGSchema() // There will always be a graphql schema node present in Dgraph cluster. So, we just need to