Apollo-tooling: Is it possible to add --watch parameter to 're-generate' types on every file change?

Created on 3 Nov 2017  路  7Comments  路  Source: apollographql/apollo-tooling

I think it'd be good dev-experience:

  1. I write some query using gql in my eg. React component.
  2. I save the file
  3. I'm instantly able to import just created query type interface that was just generated.

Most helpful comment

We're starting to look into this, and I have some experimental code that I need to get in better shape first, but I definitely hope we can make this part of codegen.

All 7 comments

Yeah, I agree, that is definitely the experience we'd want. I'd like to move features out of apollo-codegen and into a common package we can share with other tools however, and this also seems like a good candidate for that. We may also be able to integrate with graphql-language-service.

Any progress on this? I don't have anything to contribute right now, but it would be lovely to have something that.

We're currently doing this by starting a fs watch in npm scripts. The problem is, we're using gql literal tags in our ts so we have to watch */.ts and regenerate on every file change, even if no graphql stuff actually changes. Would be really nice if this could instead be handled intelligently by codegen.

We're starting to look into this, and I have some experimental code that I need to get in better shape first, but I definitely hope we can make this part of codegen.

Hey @martijnwalraven , do you think it can be implemented anywhere soon?

I don't want to look insistent, but it'd be really cool to have it @martijnwalraven :) if I can help you in any way, let me know

Would be really awesome to have the watch in apollo-cli! If there is some blocking issue with implementing it or any help needed please let the community know :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lirbank picture lirbank  路  4Comments

atbtechgit picture atbtechgit  路  3Comments

hashlin picture hashlin  路  4Comments

clayne11 picture clayne11  路  3Comments

u-ashish picture u-ashish  路  4Comments