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

Githubql querying the latest release #14

Open
Zweib opened this issue Apr 23, 2023 · 0 comments
Open

Githubql querying the latest release #14

Zweib opened this issue Apr 23, 2023 · 0 comments

Comments

@Zweib
Copy link

Zweib commented Apr 23, 2023

I just tried this to detect new release of some repository but it didn't work. I noticed that the query

	var query struct {
		Repository struct {
			ID          githubql.ID
			Name        githubql.String
			Description githubql.String
			URL         githubql.URI

			Releases struct {
				Edges []struct {
					Node struct {
						ID          githubql.ID
						Name        githubql.String
						Description githubql.String
						URL         githubql.URI
						PublishedAt githubql.DateTime
					}
				}
			} `graphql:"releases(last: 1)"`
		} `graphql:"repository(owner: $owner, name: $name)"`
	}

always gets the oldest release.

If I changed the query to graphql:"releases(first: 1)" it will get the newest release and everything goes well.

Maybe github inverted the sort direction of graphql api recently?

@Zweib Zweib changed the title githubql query the latest release Githubql querying the latest release Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant