Is your feature request related to a problem?
Thanks for your all effort for making this ๐ฅ and โฅ๏ธ framework. This is my goto framework when I work with go โ๐ป. And I also work extensively with graphql and It would be cool to have a official graphql plugin ๐ฅ.
Describe the solution you'd like
An official graphql plugin.
Additional context
Official Javascript implemetation: https://github.com/graphql/graphql-js
Fastify.js Implementation: https://github.com/mcollina/fastify-gql
Thanks for opening your first issue here! ๐ Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord
Hi @numToStr , thanks for bringing up this issue!
We have however discussed this feature request in the past, however we do not think a GraphQL library should be official but rather something the end-user can import into their application.
I do recommend checking out https://github.com/arsmn/gqlgen and https://github.com/Just4Ease/fiber-gqlgen for importing GraphQL with Fiber.
Thank you for opening your first issue! ๐
Is there any documentation for using official graphql library (https://github.com/graphql-go/graphql) with fiber?
Hi @numToStr , thanks for bringing up this issue!
We have however discussed this feature request in the past, however we do not think a GraphQL library should be official but rather something the end-user can import into their application.
I do recommend checking out https://github.com/arsmn/gqlgen and https://github.com/Just4Ease/fiber-gqlgen for importing GraphQL with Fiber.
Thank you for opening your first issue! ๐
Can you create an official recipe as to integrate with gqlgen?
Especially for the context integration.
https://github.com/arsmn/gqlgen raises errors.

TnX
@kockok are you able to fix it?
@kockok are you able to fix it?
No, switched back to gin.
I have implemented gofiber with gqlgen and it is working for queries and mutations; however, subscriptions won't work because I need websockets. I tried to use gofiber websocket but it just not work. Has anyone successfully implemented gqlgen subscriptions with gofiber?
Could you show us what gqlgen subscriptions are?
Could you show us what gqlgen subscriptions are?
Got it working with arsmn's fork for fiber.
I have a new issue on: https://github.com/99designs/gqlgen/issues/1281
Hi!
How I solved the problem without subscriptions yet
package main
import (
"net/http"
"github.com/99designs/gqlgen/graphql/playground"
"github.com/99designs/gqlgen/graphql/handler"
"github.com/gofiber/fiber"
"github.com/valyala/fasthttp/fasthttpadaptor"
)
func main() {
app := fiber.New()
app.Post("/query", func(ctx *fiber.Ctx) {
h := handler.NewDefaultServer(NewExecutableSchema(Config{Resolvers: &Resolver{}}))
fasthttpadaptor.NewFastHTTPHandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
h.ServeHTTP(writer, request)
})(ctx.Fasthttp)
})
app.Get("/", func(ctx *fiber.Ctx) {
h := playground.Handler("GraphQL", "/query")
fasthttpadaptor.NewFastHTTPHandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
h.ServeHTTP(writer, request)
})(ctx.Fasthttp)
})
app.Listen(3000)
}
To use @ftomza 's code on fiber/v2, instead of ctx.Fasthttp you have to use ctx.Context().
Most helpful comment
No, switched back to
gin.