File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,10 @@ import (
1313)
1414
1515const (
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"
1920)
2021
2122type Handler struct {
@@ -94,7 +95,15 @@ func NewRequestOptions(r *http.Request) *RequestOptions {
9495 }
9596
9697 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+ }
98107 case ContentTypeJSON :
99108 fallthrough
100109 default :
You can’t perform that action at this time.
0 commit comments