Skip to content

Commit

Permalink
fix fileupload example
Browse files Browse the repository at this point in the history
  • Loading branch information
vektah committed Jul 26, 2020
1 parent ad675f0 commit 6be2e9d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions example/fileupload/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log"
"net/http"

"github.com/99designs/gqlgen/graphql/handler/extension"
"github.com/99designs/gqlgen/graphql/handler/transport"

"github.com/99designs/gqlgen/graphql/playground"
Expand All @@ -23,12 +24,13 @@ func main() {

var mb int64 = 1 << 20

srv := handler.New(fileupload.NewExecutableSchema(fileupload.Config{Resolvers: resolver}))

srv := handler.NewDefaultServer(fileupload.NewExecutableSchema(fileupload.Config{Resolvers: resolver}))
srv.AddTransport(transport.POST{})
srv.AddTransport(transport.MultipartForm{
MaxMemory: 32 * mb,
MaxUploadSize: 50 * mb,
})
srv.Use(extension.Introspection{})

http.Handle("/query", srv)
log.Print("connect to http://localhost:8087/ for GraphQL playground")
Expand Down

0 comments on commit 6be2e9d

Please sign in to comment.