File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,14 @@ import (
13
13
)
14
14
15
15
const (
16
- ContentTypeJSON = "application/json"
17
- ContentTypeGraphQL = "application/graphql"
18
- ContentTypeFormURLEncoded = "application/x-www-form-urlencoded"
16
+ ContentTypeJSON = "application/json"
17
+ ContentTypeGraphQL = "application/graphql"
18
+ ContentTypeFormURLEncoded = "application/x-www-form-urlencoded"
19
+ ContentTypeMultipartFormData = "multipart/form-data"
19
20
)
20
21
21
22
type Handler struct {
22
- Schema * graphql.Schema
23
+ Schema * graphql.Schema
23
24
pretty bool
24
25
graphiql bool
25
26
}
@@ -92,7 +93,15 @@ func NewRequestOptions(r *http.Request) *RequestOptions {
92
93
}
93
94
94
95
return & RequestOptions {}
95
-
96
+ case ContentTypeMultipartFormData :
97
+ variables := make (map [string ]interface {}, len (r .FormValue ("variables" )))
98
+ variablesStr := r .FormValue ("variables" )
99
+ json .Unmarshal ([]byte (variablesStr ), & variables )
100
+ return & RequestOptions {
101
+ Query : r .FormValue ("query" ),
102
+ Variables : variables ,
103
+ OperationName : r .FormValue ("operationName" ),
104
+ }
96
105
case ContentTypeJSON :
97
106
fallthrough
98
107
default :
You can’t perform that action at this time.
0 commit comments