Skip to content

Commit

Permalink
Merge pull request #4 from mjarkk/master
Browse files Browse the repository at this point in the history
Fix half of the readme in code block
  • Loading branch information
jpascal authored Feb 14, 2020
2 parents 86c9aa3 + e8e3459 commit 5e455d9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@
Middleware and an [`Upload` scalar](#class-graphqlupload) to add support for [GraphQL multipart requests](https://github.com/jaydenseric/graphql-multipart-request-spec) (file uploads via queries and mutations) to various golang GraphQL servers.

## Installation
````
```bash
go get github.com/jpascal/graphql-upload
```

## Usage

```go
server := &http.Server{Addr: "0.0.0.0:5000", Handler: handler.New(func(request *handler.Request) interface{} {
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
}),
}
}, &handler.Config {MaxBodySize: 1024}),
}
server.ListenAndServe()
```

Expand Down

0 comments on commit 5e455d9

Please sign in to comment.