storj/satellite/console/consoleweb/consoleql/schema.go
Moby von Briesen 8d1a765fd6 satellite/console: Partially revert change to remove graphql
This partially reverts commit 516241e406.

Endpoints are added to the backend, as there are some customers who may
use these endpoints, even though they are no longer necessary for the
satellite UI.

Change-Id: I52a99912d9eacf269fbb2ddca603e53c4af6d6bf
2023-09-07 20:50:24 +00:00

28 lines
670 B
Go

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package consoleql
import (
"github.com/graphql-go/graphql"
"go.uber.org/zap"
"storj.io/storj/satellite/console"
"storj.io/storj/satellite/mailservice"
)
// CreateSchema creates a schema for satellites console graphql api.
func CreateSchema(log *zap.Logger, service *console.Service, mailService *mailservice.Service) (schema graphql.Schema, err error) {
creator := TypeCreator{}
err = creator.Create(log, service, mailService)
if err != nil {
return
}
return graphql.NewSchema(graphql.SchemaConfig{
Query: creator.RootQuery(),
Mutation: creator.RootMutation(),
})
}