-
Notifications
You must be signed in to change notification settings - Fork 749
Fix request body creator non-default implementations getting hammered by compiler #1450
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
Changes from 2 commits
03928df
b7731e6
47e38f4
cb96c4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,7 +69,10 @@ open class UploadRequest<Operation: GraphQLOperation>: HTTPRequest<Operation> { | |
| // Make sure all fields for files are set to null, or the server won't look | ||
| // for the files in the rest of the form data | ||
| let fieldsForFiles = Set(files.map { $0.fieldName }).sorted() | ||
| var fields = self.requestBodyCreator.requestBody(for: operation, sendOperationIdentifiers: shouldSendOperationID) | ||
| var fields = self.requestBodyCreator.requestBody(for: operation, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. better to not change this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has to change due to the removal of the default values for these parameters There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @designatednerd , although the default values for these parameters has been removed, but I think it's a good idea to add a new extension method like this:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll consider that, but I am concerned that would run a significant risk of reintroducing this same problem. |
||
| sendOperationIdentifiers: shouldSendOperationID, | ||
| sendQueryDocument: true, | ||
| autoPersistQuery: false) | ||
| var variables = fields["variables"] as? GraphQLMap ?? GraphQLMap() | ||
| for fieldName in fieldsForFiles { | ||
| if | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -270,7 +270,10 @@ public class WebSocketTransport { | |
| } | ||
|
|
||
| func sendHelper<Operation: GraphQLOperation>(operation: Operation, resultHandler: @escaping (_ result: Result<JSONObject, Error>) -> Void) -> String? { | ||
| let body = requestBodyCreator.requestBody(for: operation, sendOperationIdentifiers: self.sendOperationIdentifiers) | ||
| let body = requestBodyCreator.requestBody(for: operation, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do not change this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has to change due to the removal of the default values for these parameters |
||
| sendOperationIdentifiers: self.sendOperationIdentifiers, | ||
| sendQueryDocument: true, | ||
| autoPersistQuery: false) | ||
| let sequenceNumber = "\(sequenceNumberCounter.increment())" | ||
|
|
||
| guard let message = OperationMessage(payload: body, id: sequenceNumber).rawMessage else { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.