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 }