Skip to content

Githubql querying the latest release #14

@Zweib

Description

@Zweib

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions