Skip to content
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

Introducing RequestCreator protocol #771

Merged

Conversation

kimdv
Copy link
Contributor

@kimdv kimdv commented Sep 18, 2019

This will make it possible to modify how requests are created.

Useful in file uploads as the specs can be different from framework to framework

Copy link
Contributor

@designatednerd designatednerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks from the failures like you'll need to update the tests to use the ApolloRequestCreator instance rather than the RequestCreator static methods

Sources/Apollo/HTTPNetworkTransport.swift Outdated Show resolved Hide resolved
Sources/Apollo/HTTPNetworkTransport.swift Outdated Show resolved Hide resolved
Sources/Apollo/MultipartFormData.swift Show resolved Hide resolved
Sources/Apollo/RequestCreator.swift Outdated Show resolved Hide resolved
@kimdv kimdv marked this pull request as ready for review September 18, 2019 19:32
@designatednerd
Copy link
Contributor

@kimdv I think you missed a couple in the websocket tests

@kimdv
Copy link
Contributor Author

kimdv commented Sep 20, 2019

Should be fixed!
Sorry 🤦‍♂️

public let originalName: String
public let mimeType: String
public let inputStream: InputStream
public let contentLength: UInt64
Copy link
Contributor Author

@kimdv kimdv Sep 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those fields need to be public if users have to make things like

files.forEach {
    formData.appendPart(inputStream: $0.inputStream, contentLength: $0.contentLength, name: $0.fieldName, contentType: $0.mimeType, filename: $0.originalName)
}

@designatednerd designatednerd merged commit fd17411 into apollographql:master Sep 21, 2019
@designatednerd
Copy link
Contributor

:shipit: This will ship with 0.16.0 (hopefully early next week)

@designatednerd designatednerd added this to the 0.16.0 milestone Sep 21, 2019
@kimdv kimdv deleted the kimdv/add-request-creator-protocol branch September 22, 2019 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants