-
Notifications
You must be signed in to change notification settings - Fork 2k
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
The MicroRequest
type for apollo-server-micro
is not exported correctly
#6877
Comments
Out of curiosity, do you actually use micro? Or are you merely using |
Your second assumption is correct. I saw the use of An acquaintance guided me to your own PR using After trying to get it running myself there were different problems with newer versions of Next not allowing for top-level awaits (v12 and SWC seem to have dropped that) and generally missing typings for other parts used within the PR. Eventually I continued using the micro version which seems to work completely fine so far. |
I guess you can just copy the MicroRequest type from https://github.com/apollographql/apollo-server/blob/main/packages/apollo-server-micro/src/types.ts We will be releasing Apollo Server 4 soon at which point any Micro integration can be maintained by community members that actually use Micro (although as far as we can tell, nobody actually uses Micro and people who use apollo-server-micro are only using it due to the Next.JS example). Adding more functionality to this dead-end package is not a priority at this time. Note that AS4 has more explicit APIs for supporting server environments such as Next.JS which don't allow for a standard "startup might fail and you shouldn't start handling requests until after startup has succeeded" flow, so I should be able to replace that PR with one that they hopefully will merge. |
I was attempting to type the factory for a custom context myself as follows:
According to the docs the type of the argument for the factory should be
{ req: MicroRequest, res: ServerResponse }
however theMicroRequest
type is not accesible as it is not exported from the root of the package.The text was updated successfully, but these errors were encountered: