storj/bootstrap/bootstrapweb/bootstrapserver/bootstrapql/schema.go

25 lines
505 B
Go
Raw Normal View History

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package bootstrapql
import (
"github.com/graphql-go/graphql"
"storj.io/storj/bootstrap/bootstrapweb"
)
// CreateSchema creates a schema for bootstrap graphql api
func CreateSchema(service *bootstrapweb.Service) (schema graphql.Schema, err error) {
2019-04-04 15:56:20 +01:00
creator := TypeCreator{}
2019-04-04 15:56:20 +01:00
err = creator.Create(service)
if err != nil {
return
}
2019-04-04 15:56:20 +01:00
return graphql.NewSchema(graphql.SchemaConfig{
Query: creator.RootQuery(),
})
}