graphqlbackend

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package graphqlbackend provides a GraphQL-shaped upstream that echoes the request body back verbatim, unwrapped, as the response body.

Index

Constants

View Source
const Port = 3017

Port is the container port used by the testbench.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct{}

Service implements the stateless GraphQL backend testbench service.

func New

func New() *Service

New creates a graphqlbackend service.

func (*Service) Handler

func (s *Service) Handler() http.Handler

Handler returns the graphqlbackend service's HTTP handler.

Every non-/health request gets the raw request body echoed back verbatim as the response body, with no wrapping envelope. This is what a test needs to control the gateway's response-phase GraphQL analytics enrichment (isError/errorCount/isPartialSuccess): the generic reflect-style backends (services/backend, services/echo) always wrap the body in their own {method,path,...} envelope, so a request-supplied top-level "errors" array can never appear at the top level of their response the way a real GraphQL server's would.

func (*Service) Name

func (s *Service) Name() string

Name returns the service registration name.

func (*Service) Port

func (s *Service) Port() int

Port returns the service's listening port.

func (*Service) Stateful

func (s *Service) Stateful() bool

Stateful reports whether the service keeps request-specific state.

Jump to

Keyboard shortcuts

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