-
Notifications
You must be signed in to change notification settings - Fork 605
Closed
Description
Describe the bug
Using gqlgen's playground handler, try to route it with hertz using hertz's adaptor pkg.
Failed at hertz/pkg/protocol/http1/server.go line 409 zw.Flush()
The Err says netpoll.ErrConnClosed (257)
To Reproduce
Steps to reproduce the behavior:
playHandler := playground.Handler("GraphQL Playground", "/graph")
HertzRouter.GET("/",
//func(c context.Context, ctx *app.RequestContext) {
// ctx.Header("Content-Type", "application/json; charset=utf-8")
//},
adaptor.HertzHandler(playHandler),
)
Expected behavior
Works like using Gin
r := gin.Default()
r.GET("/", func(c *gin.Context) {
srv := playground.Handler("GraphQL Playground", "/graph")
srv.ServeHTTP(c.Writer, c.Request)
})
Screenshots
Hertz version:
Current Default Branch: develop
v0.10.1-0.20250612030729-54807216e31c
Gqlgen version: also latest
github.com/99designs/gqlgen v0.17.75-0.20250612053100-3b5d2c6cba1d
Environment:
go env
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE='on'
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN='/Users/stark_sim/go_workspace/bin'
GOCACHE='/Users/stark_sim/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/stark_sim/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/cv/pxn1k07d4sxdcgx4tr5hblgw0000gn/T/go-build408552602=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/stark_sim/GolandProjects/newcas/go.mod'
GOMODCACHE='/Users/stark_sim/go_workspace/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/stark_sim/go_workspace'
GOPRIVATE=''
GOPROXY='https://goproxy.cn'
GOROOT='/Users/stark_sim/go_workspace/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.darwin-arm64'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/stark_sim/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/stark_sim/go_workspace/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.darwin-arm64/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.0'
GOWORK=''
PKG_CONFIG='pkg-config'
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
No labels