Skip to content
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

Generate type files on save #11

Open
davidbaiguini opened this issue Jul 28, 2019 · 1 comment
Open

Generate type files on save #11

davidbaiguini opened this issue Jul 28, 2019 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@davidbaiguini
Copy link

Hi,

First of all. This is an amazing repo that is super helpful to start a project with a similar stack.

It is more a question than a bug. I realized that the type files for both TS and GrapqhQL are (re)generated only when a new GraphQL query is executed.
If I look at the examples from nexus repo like this one, I noticed they are using ts-node-dev

Did you find any way to achieve the same behavior using the serverless-offline plugin?
It is quite a big drawback not to have the TS types available without having to run the server first.

Cheers

@Gomah
Copy link
Owner

Gomah commented Jul 30, 2019

Hi @davidbaiguini,

Indeed, it only regenerates the nexus files when hitting a request on the endpoint, if you leave the playground open, it should be fine.

An alternative solution could be to use rp in your terminal to replay the last HTTP request and regenerates the nexus files:

Serverless: Offline [HTTP] listening on http://localhost:1337
Serverless: Enter "rp" to replay the last request

It would be ideal to generate the nexus files on save but I'm not sure how to do that yet (probably a webpack configuration thing), any contributions are welcome 👍

@Gomah Gomah added the help wanted Extra attention is needed label Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants