From de113f969220b95e48cb64439069a13370dc26d6 Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Fri, 4 Nov 2016 16:30:30 +0100 Subject: [PATCH] added MustParseSchema --- graphql.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/graphql.go b/graphql.go index da29bbfb8ef..80465a4932c 100644 --- a/graphql.go +++ b/graphql.go @@ -26,6 +26,14 @@ func ParseSchema(schemaString string, resolver interface{}) (*Schema, error) { return b.ApplyResolver(resolver) } +func MustParseSchema(schemaString string, resolver interface{}) *Schema { + s, err := ParseSchema(schemaString, resolver) + if err != nil { + panic(err) + } + return s +} + type SchemaBuilder struct { schema *schema.Schema }