Skip to content

Apollo Server 2: Add file uploads#1071

Merged
evans merged 9 commits into
refactor-2.0from
server-2.0/file-uploads
May 29, 2018
Merged

Apollo Server 2: Add file uploads#1071
evans merged 9 commits into
refactor-2.0from
server-2.0/file-uploads

Conversation

@evans

@evans evans commented May 16, 2018

Copy link
Copy Markdown
Contributor

This PR adds file uploads to the apollo server 2

  • Update CHANGELOG.md with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests

@evans evans added this to the Release 2.0 milestone May 16, 2018
@evans evans force-pushed the server-2.0/file-uploads branch from 8de623f to d89919d Compare May 22, 2018 18:28
@evans evans force-pushed the server-2.0/file-uploads branch from d89919d to beeac26 Compare May 24, 2018 23:59
@evans evans requested a review from jbaxleyiii May 29, 2018 08:46
@evans evans force-pushed the server-2.0/file-uploads branch from 0aea400 to 1ca87e3 Compare May 29, 2018 08:56
it('enabled uploads', async () => {
server = new ApolloServer({
typeDefs: gql`
scalar Upload

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Needing to add this line is frustrating. When it is removed, the makeExecutableSchema in the constructor fails. We could delay the evaluation of the typeDefs and resolvers until later when this.schema is used with a getter. This feels a bit weird, since the mocks are added in the constructor, so could or could not affect the typeDefs later added to the schema with enhanceSchema

Before the current and past two commits, we had the upload configuration code in the ApolloServer constructor. However fileuploads seem to be a integration specific concern, so I'm pretty convinced that uploads should be configured in registerServer

@evans

evans commented May 29, 2018

Copy link
Copy Markdown
Contributor Author

To view the state of the repository when the file upload configuration was done in the constructor, please look at this commit.

@evans evans force-pushed the server-2.0/file-uploads branch from 095e1dd to e9d076d Compare May 29, 2018 17:03
@evans evans merged commit 5412885 into refactor-2.0 May 29, 2018
@evans evans deleted the server-2.0/file-uploads branch May 29, 2018 22:58
This was referenced May 29, 2018
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant