Open adriatic opened 2 years ago
Yeah, this is not a problem with any particular RW project. If we should/could fix it, it'd be in the framework code for type generation. I'm not sure what change needs to be made though. If you could dig into it and find a solution that'd be awesome :)
@Tobbe - I believe that I did find the change and it is trivial - please check my explanation to @rushabhhere (https://github.com/rushabhhere) so I do not pollute all discussions with my comments 😸 .
I reported this https://github.com/redwoodjs/redwood/issues/6078 issue, discovered in the context of trying to create a TypeScript version of the Redwood Tutorial. At that time I was not aware of the same effort by @rushabhhere. As I was having the similar issue with a different application (redwood-stripe) I decided to convert the redwood tutorial app to typescript hoping to better understand my original problem, described below
In order to reproduce my issue create any TypeScript app
yarn create redwood-app --ts ./myapp
Observe the just generated file
graphql.d.ts
inapi/types
folder, the definition of thescalars
typeThis same code rendered by VSCode is:
The issue with JSON and JSONObject is
Seemingly an
import
statement is missing 😺