File tree 1 file changed +13
-4
lines changed 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,10 @@ 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 {
@@ -94,7 +95,15 @@ func NewRequestOptions(r *http.Request) *RequestOptions {
94
95
}
95
96
96
97
return & RequestOptions {}
97
-
98
+ case ContentTypeMultipartFormData :
99
+ variables := make (map [string ]interface {}, len (r .FormValue ("variables" )))
100
+ variablesStr := r .FormValue ("variables" )
101
+ json .Unmarshal ([]byte (variablesStr ), & variables )
102
+ return & RequestOptions {
103
+ Query : r .FormValue ("query" ),
104
+ Variables : variables ,
105
+ OperationName : r .FormValue ("operationName" ),
106
+ }
98
107
case ContentTypeJSON :
99
108
fallthrough
100
109
default :
You can’t perform that action at this time.
0 commit comments