-
Notifications
You must be signed in to change notification settings - Fork 14
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
[Experimental] Add Subscription Support for the Tanzu Hub Client #195
[Experimental] Add Subscription Support for the Tanzu Hub Client #195
Conversation
8648cea
to
c4596c9
Compare
c4596c9
to
b808850
Compare
- Refactor the code - Remove dependency on github.com/Khan/genqlient/graphql client. - Implement Interface for HubClient - Add Request and Subscribe methods natively
b808850
to
bfacea1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice set of functionality to add to the hub client!
Still looking at the changes, but left some comments of mostly minor things I noticed so far.
client/hub/README.md
Outdated
@@ -40,3 +39,77 @@ To use this library plugin authors can follow the below steps: | |||
4. Once the initialization is done, you can add your GraphQL queries to the `queries.graphql` file | |||
5. After adding new graphQL queries or updating an existing query, run `make tanzu-hub-stub-generate` to generate a golang stub for the GraphQL queries | |||
* This will create a `generate.go` file under the `hub` package with golang APIs that can be consumed directly by other packages by passing the GraphQLClient available with TanzuHub client | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of preexisting things I noticed while testing this change:
3 lines up on "main.go": I recall making a comment about not using main.go since it is confusing. Did we run into some issue and decided to stick with it?
nit The tanzuhub.mk's tanzu-hub-stub-init
target should be commented with ##
instead of #
so it shows up in make help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the new client does not require developers to use the github.com/Khan/genqlient/graphql
library to generate type definitions, I plan to minimize the documentation's specifications.
I intend to simply mention that users can utilize the github.com/Khan/genqlient/graphql
library to generate the GoLang stub for type definitions if needed, without providing detailed instructions on its usage. It's likely that most consumers won't need to use this library to generate stubs, as they can define their own type definitions for simple queries. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really great!
I haven't been able to finish completely and I will continue a little later, but here are some comments to start
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nits but besides that LGTM
Nice job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
thanks a lot for this!
What this PR does / why we need it
Note: This PR is on top of #191
github.com/Khan/genqlient/graphql
client.Request
andSubscribe
methods nativelySubscription
support for the testing frameworksubscription
support.Which issue(s) this PR fixes
Fixes #
Describe testing done for PR
Release note
Additional information
Special notes for your reviewer