apollo-client: RequestInit is not defined in typescript typings
Thanks for this amazing project! Loving it! A small detail:
When using apollo-client in typescript the RequestInit is not defined.
It also references the graphql library which typings is not a part of the project.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 26 (12 by maintainers)
Why close this, I’m facing this problem and I don’t want to include dom lib to my server project
Here is my solution:
Closing this, since it’s quite dated and seems to have been solved.
RequestInitis defined in fetch (isomorphic-fetch):@patriknil90 You should install
isomorphic-fetchas one of npm dependencies to add the polyfill.Then install typings as follows:
To resolve missing
RequestInitandIResponseyou should run:To fill the gap with
NodeJS:@stubailo I noticed that
IResponseis specific to isomorphic-fetch, typings ofwhatwg-fetchdoesn’t include it.It all depends on the ambient declaration:
Foois accessible globalyBaryou have to import from “graphql”