-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multipart/form-data transport to support file uploads (#268)
This can be tested with a request like: curl --url http://localhost:8082/query \ --form 'operations={"query":"mutation upload($fileA: Upload!, $fileB: Upload!) {\n\tuploadGizmoFile(upload: $fileA)\n\tuploadGadgetFile(upload: {\n\t\tupload: $fileB\n\t})\n}","variables":{"fileA":null,"fileB":null}}' \ --form 'map={ "a": ["variables.fileA"], "b": ["variables.fileB"] }' \ --form [email protected] \ --form [email protected] --------- Co-authored-by: Adam Sven Johnson <[email protected]>
- Loading branch information
Showing
18 changed files
with
572 additions
and
15 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
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,3 @@ | ||
gqlgen-service | ||
generated.go | ||
models_gen.go |
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,11 @@ | ||
FROM golang:1.22-alpine3.19 | ||
|
||
ENV CGO_ENABLED=0 | ||
|
||
WORKDIR /go/src/app | ||
|
||
COPY . . | ||
|
||
RUN go generate . | ||
RUN go get | ||
CMD go run . |
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,18 @@ | ||
ARTIFACT=gqlgen-service | ||
DEF=gqlgen.yml schema.graphql | ||
GEN=models_gen.go generated.go | ||
|
||
build: $(ARTIFACT) | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f $(ARTIFACT) $(GEN) | ||
|
||
.PHONY: generate | ||
generate: $(GEN) | ||
|
||
$(GEN): $(DEF) | ||
go generate | ||
|
||
gqlgen-service: $(GEN) $(wildcard *.go) | ||
go build |
Oops, something went wrong.