I certainly agree with you. There are use cases (such as the one you mentioned) where typed JavaScript has major benefits that not even IDEs and linting can provide.
But… this can easily go sideways and become brittle and difficult to maintain. When you have a constantly evolving API, out of date types are guaranteed. It has happened on every project I’ve worked on using Flow or TypeScript.
The best solution is to generate these types using some kind of generator (apollo-code-gen for graphQL comes to mind), that way the client always has up to date types for your API.
Unfortunately, this isn’t always available.