7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/graphql/doctor/runtime/schema_loader.rb', line 7
def self.load(config, root: Dir.pwd)
boot_environment(config["require"], root)
name = config["schema"]
raise Error, "Configuration key `schema` is required" unless name && !name.strip.empty?
schema = resolve_schema(name)
raise Error, "Configured schema `#{name}` is not a GraphQL::Schema subclass" unless graphql_schema?(schema)
schema
rescue StandardError, LoadError, SyntaxError => e
raise Error, "GQLD101: Failed to boot schema: #{e.message}"
end
|