Repository navigation
Conversation
|
|
||
| Target struct { | ||
| OID string | ||
| // commitResourcePath string |
There was a problem hiding this comment.
When uncommented, this fails with struct field for "commitResourcePath" doesn't exist in any of 1 places to unmarshal. However, copying the generated query to the GH Explorer and executing works without issue. Is there a versioning issue at play, perhaps?
The query generated by the graphql Client:
query RepositoryReleaseByTag($name: String!, $owner: String!, $tagName: String!) {
repository(owner: $owner, name: $name) {
release(tagName: $tagName) {
databaseId
id
tagName
name
description
isDraft
isPrerelease
createdAt
publishedAt
url
resourcePath
author {
id
name
login
}
releaseAssets(first: 100) {
totalCount
nodes {
id
name
size
url
createdAt
updatedAt
downloadCount
contentType
downloadUrl
uploadedBy {
id
name
login
}
}
}
tag {
id
name
target {
oid
commitResourcePath
}
}
tagCommit {
id
tarballUrl
zipballUrl
}
}
}
}There was a problem hiding this comment.
I'm also looking for feedback on which fields should be supported and which should also be the default
|
|
||
| cmd.Flags().BoolVarP(&opts.WebMode, "web", "w", false, "Open the release in the browser") | ||
| cmdutil.AddJSONFlags(cmd, &opts.Exporter, shared.ReleaseFields) | ||
| cmdutil.AddJSONFlags(cmd, &opts.Exporter, api.ReleaseFields) |
There was a problem hiding this comment.
The biggest issue I'm encountering right now is that regardless of the fields that I pass to --json, the output is the entire release object. I noticed that the pr command manually constructs the graphql query via strings and filtering on the provided fields. However, that didn't feel like the preferred way to go, but I'm unsure how to modify the query to limit the fields. Any pointers would be appreciated!
|
After further discussion, we're going to standardize on the REST API rather than GraphQL. |
Fixes #4572 (Part 1).
Before adding the
--jsonsupport torelease list, it was requested thatrelease viewbe moved to GraphQL to begin standardizing thereleasecommand on a single API. This PR represents the first step to that effect. A follow up PR will add--jsonto thelistcommand and move that to this shared model.This PR is not yet in a ready state as I have to update tests and I have some questions about behavior.
Target.commitResourcePathfails when executing the query, but the query works in the Explorer.