问题
I am using Apollo Server v2.0 (without middleware) as part of my project and I would like to add support for a HTTP GET endpoint to for file downloads. Is there a way to expose an API endpoint without using apollo-server-express?
Thank you
回答1:
No. While apollo-server
currently uses express
under the hood, the Express instance is not exposed as a property on the ApolloServer
instance. In order to expose any additional endpoints, you'd need to migrate to apollo-server-express
or any of the other available framework integrations. The migration is relatively painless since the APIs are almost identical.
来源:https://stackoverflow.com/questions/62638822/expose-http-get-api-in-graphql-apollo-server-v2-0