Skip to content

Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various GoLang GraphQL servers

License

Notifications You must be signed in to change notification settings

jpascal/graphql-upload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-upload

GitHub Actions status

Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various golang GraphQL servers.

Installation

go get github.com/jpascal/graphql-upload

Usage

server := &http.Server{
	Addr: "0.0.0.0:5000", 
	Handler: handler.New(func(request *handler.Request) interface{} {
		return graphql.Do(graphql.Params{
			RequestString:  request.Query,
			OperationName:  request.OperationName,
			VariableValues: request.Variables,
			Schema:         schema.New(),
			Context:        request.Context,
		})
	}, &handler.Config {MaxBodySize: 1024}),
}
    server.ListenAndServe()

Contributing

  1. Fork it ( https://github.com/jpascal/graphql-upload/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various GoLang GraphQL servers

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages