presentation

package
v0.0.0-...-66c1001 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MyErrorPresenter graphql.ErrorPresenterFunc = func(ctx context.Context, err error) *gqlerror.Error {
	errGql := graphql.DefaultErrorPresenter(ctx, err)
	if strings.Contains(err.Error(), smodel.ErrBase+smodel.ErrSep) {
		errMsg := err.Error()[strings.LastIndex(err.Error(), smodel.ErrBase+smodel.ErrSep):]
		errGql = graphql.DefaultErrorPresenter(ctx, errors.New(errMsg))
	}
	return errGql
}

Functions

This section is empty.

Types

type Graphql

type Graphql struct {
	// contains filtered or unexported fields
}

Graphql is the GraphQL API for the application

func NewGraphql

func NewGraphql(qh pp_query.QueryPort, ch pp_command.CommandPort) *Graphql

NewGraphql creates a new instance of Graphql

func (*Graphql) Auth

func (api *Graphql) Auth(ctx context.Context, obj interface{}, next graphql.Resolver, policy string) (interface{}, error)

func (*Graphql) Serve

func (api *Graphql) Serve(port string)

Serve starts the API server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL