Move Uploads to constructor and remove enhanceSchema#1204
Merged
Conversation
martijnwalraven
approved these changes
Jun 21, 2018
| //default we enable them if supported by the integration | ||
| } else if (uploads) { | ||
| throw new Error( | ||
| 'This implementation of ApolloServer does not support file uploads.', |
Contributor
There was a problem hiding this comment.
Is there any way we can make this more specific? We want to make sure people understand it is because of the framework/environment they are using.
| onDisconnect?: (websocket: WebSocket, context: ConnectionContext) => any; | ||
| } | ||
|
|
||
| // This configuration is shared between all intetgrations and should include |
Contributor
There was a problem hiding this comment.
Typo (integrations)
| // This error began appearing randomly and seems to be a dev dependency bug. | ||
| // https://github.com/jaydenseric/apollo-upload-server/blob/18ecdbc7a1f8b69ad51b4affbd986400033303d4/test.js#L39-L42 | ||
| if (error.code !== 'EPIPE') throw error; | ||
| // if (error.code !== 'EPIPE') throw error; |
Contributor
There was a problem hiding this comment.
It seems dangerous to just swallow all errors here. Did you ever figure out why this test throws?
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This places uploads configuration inside of the constructor, since the logic is the same across multiple integrations. Including it in the constructor follows the same logic as subscriptions.