Skip to content

Commit

Permalink
Improve format, inline const.
Browse files Browse the repository at this point in the history
  • Loading branch information
hantonelli committed Mar 31, 2019
1 parent 662dc33 commit fc31836
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion codegen/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/pkg/errors"
"github.com/vektah/gqlparser"
"github.com/vektah/gqlparser/ast"
yaml "gopkg.in/yaml.v2"
"gopkg.in/yaml.v2"
)

type Config struct {
Expand Down Expand Up @@ -379,6 +379,7 @@ func (c *Config) LoadSchema() (*ast.Schema, map[string]string, error) {
schemaStrings := map[string]string{}

var sources []*ast.Source

for _, filename := range c.SchemaFilename {
filename = filepath.ToSlash(filename)
var err error
Expand Down
3 changes: 1 addition & 2 deletions handler/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

const (
defaultMaxMemory = 32 << 20 // 32 MB
variablePrefix = "variables."
)

type params struct {
Expand Down Expand Up @@ -539,7 +538,7 @@ func processMultipart(r *http.Request, request *params) error {
Size: header.Size,
Filename: header.Filename,
}
if len(path) != 1 || !strings.HasPrefix(path[0], variablePrefix) {
if len(path) != 1 || !strings.HasPrefix(path[0], "variables.") {
return errors.New(fmt.Sprintf("invalid value for key %s", key))
}
addUploadToOperations(operations, upload, path[0])
Expand Down

0 comments on commit fc31836

Please sign in to comment.