Skip to content

Commit 3a92531

Browse files
committed
made getters more predictable
1 parent fc7448c commit 3a92531

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

graphql.go

+15-16
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,21 @@ func (req *Request) Var(key string, value interface{}) {
290290
req.vars[key] = value
291291
}
292292

293+
// Vars gets the variables for this Request.
294+
func (req *Request) Vars() map[string]interface{} {
295+
return req.vars
296+
}
297+
298+
// Files gets the files in this request.
299+
func (req *Request) Files() []File {
300+
return req.files
301+
}
302+
303+
// Query gets the query string of this request.
304+
func (req *Request) Query() string {
305+
return req.q
306+
}
307+
293308
// File sets a file to upload.
294309
// Files are only supported with a Client that was created with
295310
// the UseMultipartForm option.
@@ -307,19 +322,3 @@ type File struct {
307322
Name string
308323
R io.Reader
309324
}
310-
311-
// RequestVars gets the variables from a Request.
312-
func RequestVars(req *Request) map[string]interface{} {
313-
return req.vars
314-
}
315-
316-
// RequestQuery gets the query from the Request.
317-
func RequestQuery(req *Request) string {
318-
return req.q
319-
}
320-
321-
// RequestFiles gets the files that have been set in a
322-
// Request.
323-
func RequestFiles(req *Request) []File {
324-
return req.files
325-
}

0 commit comments

Comments
 (0)