-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support file upload in router (#758)
This PR makes possible to support a file upload according to spec: https://github.com/jaydenseric/graphql-multipart-request-spec With this PR merged to main and released we can discuss and work on PR to support the feature in cosmo router: wundergraph/cosmo#652 Basically, this PR makes possible to pass a temporary file information stored in file system to structures responsible for graphql resolve operation. Additionally, introduces a method in nethttpclient.go to actually perform the multipart http request. --------- Co-authored-by: pedraumcosta <costa@hcx.us> Co-authored-by: thisisnithin <nithinkumar5353@gmail.com>
- Loading branch information
1 parent
4a807c5
commit 627a7ce
Showing
17 changed files
with
435 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package httpclient | ||
|
||
type File interface { | ||
Path() string | ||
Name() string | ||
} | ||
|
||
type internalFile struct { | ||
path string | ||
name string | ||
} | ||
|
||
func NewFile(path string, name string) File { | ||
return &internalFile{ | ||
path: path, | ||
name: name, | ||
} | ||
} | ||
|
||
func (f *internalFile) Path() string { | ||
return f.path | ||
} | ||
|
||
func (f *internalFile) Name() string { | ||
return f.name | ||
} |
Oops, something went wrong.