-
Notifications
You must be signed in to change notification settings - Fork 7.3k
♻️ Refactor gist list to use graphQL #1763
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
Conversation
Signed-off-by: Matthew Gleich <[email protected]>
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 looks fantastic; thank you!
I think that the stubs in tests need to be updated to compensate for the switch to GraphQL
|
Yep. I was looking into it yesterday and I'll try to get it working. Haven't really worked with the testing side of things with graphql before so I might need a little help. |
Signed-off-by: Matthew Gleich <[email protected]>
Signed-off-by: Matthew Gleich <[email protected]>
It's not sufficient to use `Changed("public")` to test if a boolean flag
was activated, since the user might have passed `--public=false`.
Instead, check the true value of the flag.
The `--public` and `--secret` flags should be mutually exclusive, so now
if both are activated, `--secret` takes precedence.
- Fetching more than 100 gists is now supported - The GraphQL query name is now `GistList` instead of `ListGists` for consistency with other queries - Avoid fetching unnecessary Files fields - Gists are now rendered in the order that the API returned them in - The gist timestamp for machine-readable output is now rendered in RFC3339 format instead of in `time.Time.String()` format which is only meant for debugging and is not considered stable - Ensure newlines in gist description are rendered as spaces
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.
@Matt-Gleich Thanks for the updates!
@vilmibm I've added a number of changes to this branch:
- Ported the GraphQL query to "githubv4" adapter
- Fetching more than 100 gists is now supported
- The GraphQL query name is now
GistListinstead ofListGistsfor consistency with other queries - Avoid fetching unnecessary Files fields
- Gists are now rendered in the order that the API returned them in (CreatedAt desc) instead of reordered by UpdatedAt timestamp - should we consider displaying the CreatedAt timestamp instead of UpdatedAt?
- The gist timestamp for machine-readable output is now rendered in RFC3339 format instead of in
time.Time.String()format which is only meant for debugging and is not considered stable - Ensure newlines in gist description are rendered as spaces
- It's not sufficient to use
Changed("public")to test if a boolean flag was activated, since the user might have passed--public=false. Instead, check the true value of the flag. - The
--publicand--secretflags should be mutually exclusive, so now if both are activated,--secrettakes precedence.
This PR resolves #1712.