99designs / gqlgen-contrib

Add-ons for gqlgen
The Unlicense
89 stars 34 forks source link

Doesn't work with latest gqlgen. #26

Closed cheshir closed 2 years ago

cheshir commented 3 years ago

I'm using:

github.com/99designs/gqlgen v0.13.0
github.com/99designs/gqlgen-contrib v0.1.0

What I'm trying to do:

import (
    gqlHandler "github.com/99designs/gqlgen/graphql/handler"
    "github.com/99designs/gqlgen-contrib/gqlopentracing"
    "github.com/99designs/gqlgen-contrib/prometheus"
)

// ...

gqlServer := gqlHandler.New(
    // ...
)

gqlServer.Use(gqlopentracing.New())              
gqlServer.Use(prometheus.RequestMiddleware())
gqlServer.AroundFields(prometheus.ResolverMiddleware())

What I expect to have: application started without errors, application has metrics and traces support.

What I have:

# github.com/99designs/gqlgen-contrib/gqlopentracing
../../../../go/pkg/mod/github.com/99designs/gqlgen-contrib@v0.1.0/gqlopentracing/tracer.go:13:7: undefined: graphql.Tracer
../../../../go/pkg/mod/github.com/99designs/gqlgen-contrib@v0.1.0/gqlopentracing/tracer.go:17:12: undefined: graphql.Tracer
../../../../go/pkg/mod/github.com/99designs/gqlgen-contrib@v0.1.0/gqlopentracing/tracer.go:74:19: reqCtx.GetErrors undefined (type *graphql.OperationContext has no field or method GetErrors)
# github.com/99designs/gqlgen-contrib/prometheus
../../../../go/pkg/mod/github.com/99designs/gqlgen-contrib@v0.1.0/prometheus/prometheus.go:121:26: undefined: graphql.RequestMiddleware
../../../../go/pkg/mod/github.com/99designs/gqlgen-contrib@v0.1.0/prometheus/prometheus.go:131:20: reqCtx.GetErrors undefined (type *graphql.OperationContext has no field or method GetErrors)
tbflw commented 3 years ago

We have run into the same issue, since we need to upgrade sqlgen due to the vulnerability in the dependency on gorilla/websocket fixed in https://github.com/gorilla/websocket/releases/tag/v1.4.1. @cheshir have you looked into what it will take to fix this?

bstanescu commented 3 years ago

I had the same issue, I installed the dependency to this package by using a module query to get the code from the master branch:

go get github.com/99designs/gqlgen-contrib@master
davidxia commented 3 years ago

@vvakame Hi, could you release a newer version to resolve this issue? 🙏

jmandel1027 commented 3 years ago

@vvakame we're facing this same issue ourselves, i had to remove this package since it was no longer working but we have grafana boards that utilize the info this pkg provides us and would love to turn it back online

r0fls commented 3 years ago

Does anyone know of a workaround? Are people just copying this code and making it work for them? I get this error trying to use this, even with the master branch: undefined: "github.com/99designs/gqlgen-contrib/prometheus".RequestMiddleware

LockedThread commented 3 years ago

Does anyone know of a workaround? Are people just copying this code and making it work for them? I get this error trying to use this, even with the master branch: undefined: "github.com/99designs/gqlgen-contrib/prometheus".RequestMiddleware

I second this