-
Couldn't load subscription status.
- Fork 683
[FileUpload] Allow to encode custom scalar types as null and use it for file uploads #2566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
2 changes: 1 addition & 1 deletion
2
...st/fixtures/ApolloServerInterceptorFileUploadTest/expectedOperationsPartBodyMultiple.json
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| {"operationName":"MultipleUpload","variables":{"files":["image/jpg","image/png"]},"query":"mutation MultipleUpload($files: [Upload!]!) { multipleUpload(files: $files) { __typename id path filename mimetype } }"} | ||
| {"operationName":"MultipleUpload","variables":{"files":[null,null]},"query":"mutation MultipleUpload($files: [Upload!]!) { multipleUpload(files: $files) { __typename id path filename mimetype } }"} |
2 changes: 1 addition & 1 deletion
2
...test/fixtures/ApolloServerInterceptorFileUploadTest/expectedOperationsPartBodyNested.json
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| {"operationName":"NestedUpload","variables":{"topFile":"image/png","topFileList":["image/jpg","plain/txt"],"nested":{"recursiveNested":[{"file":"plain/txt","fileList":["image/jpg","image/png"]},{"file":"image/jpg","fileList":["plain/txt","image/png"]}],"file":"image/png","fileList":["plain/txt","image/jpg"]}},"query":"mutation NestedUpload($topFile: Upload, $topFileList: [Upload], $nested: NestedObject) { nestedUpload(topFile: $topFile, topFileList: $topFileList, nested: $nested) }"} | ||
| {"operationName":"NestedUpload","variables":{"topFile":null,"topFileList":[null,null],"nested":{"recursiveNested":[{"file":null,"fileList":[null,null]},{"file":null,"fileList":[null,null]}],"file":null,"fileList":[null,null]}},"query":"mutation NestedUpload($topFile: Upload, $topFileList: [Upload], $nested: NestedObject) { nestedUpload(topFile: $topFile, topFileList: $topFileList, nested: $nested) }"} |
2 changes: 1 addition & 1 deletion
2
...test/fixtures/ApolloServerInterceptorFileUploadTest/expectedOperationsPartBodySingle.json
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| {"operationName":"SingleUpload","variables":{"file":"image/jpg"},"query":"mutation SingleUpload($file: Upload!) { singleUpload(file: $file) { __typename id path filename mimetype } }"} | ||
| {"operationName":"SingleUpload","variables":{"file":null},"query":"mutation SingleUpload($file: Upload!) { singleUpload(file: $file) { __typename id path filename mimetype } }"} |
2 changes: 1 addition & 1 deletion
2
.../test/fixtures/ApolloServerInterceptorFileUploadTest/expectedOperationsPartBodyTwice.json
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| {"operationName":"SingleUploadTwice","variables":{"file1":"image/jpg","file2":"image/png"},"query":"mutation SingleUploadTwice($file1: Upload!, $file2: Upload!) { file1: singleUpload(file: $file1) { __typename id path filename mimetype } file2: singleUpload(file: $file2) { __typename id path filename mimetype } }"} | ||
| {"operationName":"SingleUploadTwice","variables":{"file1":null,"file2":null},"query":"mutation SingleUploadTwice($file1: Upload!, $file2: Upload!) { file1: singleUpload(file: $file1) { __typename id path filename mimetype } file2: singleUpload(file: $file2) { __typename id path filename mimetype } }"} |
237 changes: 0 additions & 237 deletions
237
.../test/java/com/apollographql/apollo/internal/interceptor/ApolloServerInterceptorTest.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we introduce
writeNullto ourJsonWriter? 😄There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JsonWriteralready hasnullValue, would that be ok?We could also add
writeNulltoInputFieldWriterbut that would be a much more invasive change that I'm not too keen on doing in 2.x. Falling into the rabbit hole ofInputFieldsWriters, I realized thatSortedInputFieldMapWriterdoesn't handle custom scalar types. So custom scalars as field arguments will most likely fill the cache with different values. I guess something to keep in mind for3.x