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

[FEATURE] Please add watch mode #183

Closed
MaxmaxmaximusAWS opened this issue Apr 8, 2021 · 5 comments
Closed

[FEATURE] Please add watch mode #183

MaxmaxmaximusAWS opened this issue Apr 8, 2021 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@MaxmaxmaximusAWS
Copy link

Please add watch mode =)

@PabloSzx
Copy link
Contributor

PabloSzx commented Apr 8, 2021

If you have the API serving the schema besides your client, you can easily use the programmatic API https://gqless.com/cli/programmatic
We have already been using it and it works great, a watch mode doesn't have much sense in any other scenario other than trying to sync an automated output from another living instance, and for that, the programmatic API does the job way cleaner, for any other purpose, watch mode doesn't have any sense, since it would be literally just polling a graphql API for a 99.99% of no-change detection, it would be just unnecessary load for API.

@MaxmaxmaximusAWS
Copy link
Author

MaxmaxmaximusAWS commented Apr 8, 2021

P.S. Your project is amazing, today I showed it to my colleague from AWS, he is also delighted, I’ll figure out what can be done with this and how to integrate it into AWS AppSync, but after today's discussion, we agreed that the problem of AWS AppSync is in its monolithic nature, and it will be needed where then half a year to add an interlayer like Relay =), in general, I am very impressed with your development of the guys, tell me how to become your personal sponsor, not on behalf of a company, but on behalf of a person.

@samdenty
Copy link
Owner

samdenty commented Apr 8, 2021

I think a watch mode makes sense, although how we implement it is important as @PabloSzx said.

I could see how querying excessively would lead to rate-limits, so maybe a way we could work around that is to vary the interval.
For URLs that resolve to localhost / 127.0.0.1, polling every 200ms should be sufficient, other urls every 5 seconds.

A new subcommand gqless watch, would work as it'd be clear what it's doing.

If you want to send a PR the CLI is in packages/cli

Repository owner deleted a comment from MaxmaxmaximusAWS Apr 8, 2021
@samdenty samdenty added enhancement New feature or request good first issue Good for newcomers labels Apr 8, 2021
@ericwooley
Copy link

You could probably just use this https://www.npmjs.com/package/forever, and essentailly poll

@samdenty samdenty changed the title [FEATURE] Please add watch mode Watch mode Apr 12, 2021
@samdenty samdenty changed the title Watch mode [FEATURE] Please add watch mode Apr 12, 2021
@samdenty
Copy link
Owner

Closing in favour of #194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants