octokit.graphql.net icon indicating copy to clipboard operation
octokit.graphql.net copied to clipboard

AllPages throws when used on SecurityVulnerabilities

Open brphelps opened this issue 5 years ago • 5 comments

Hitting this guy: https://developer.github.com/v4/object/securityvulnerability/

Like so:

var query = new Query()
                    .SecurityVulnerabilities(10, null, null, null, SecurityAdvisoryEcosystem.Rubygems, null)
                    .AllPages(100)
                    .Select(vuln => new
                    {
                        vuln.FirstPatchedVersion.Identifier,
                        vuln.Package.Name,
                        vuln.Package.Ecosystem,
                        vuln.Severity,
                        vuln.VulnerableVersionRange
                    })
                    .Compile();

                var result = await connection.Run(query);

Produces: image

I'm assuming that in other cases there is a "secret" Id field added at the front of the list, and it's not present here.

brphelps avatar Feb 05 '20 20:02 brphelps

I don't know if a schema update might fix this?

There's a PR with one here https://github.com/octokit/octokit.graphql.net/pull/211. You could compile and pull in the DLLs or nupkg from that.

jcansdale avatar Feb 05 '20 21:02 jcansdale

@jcansdale I tried on your branch, same issue. I can't really tell without more inspection if the id selection part is just option, that is "If we don't find it should we just skip it?". If so I can commit something doing that.

brphelps avatar Feb 05 '20 22:02 brphelps

Re your query:

var query = new Query()
                    .SecurityVulnerabilities(10, null, null, null, SecurityAdvisoryEcosystem.Rubygems, null)
                    .AllPages(100)

I didn't think you needed to set the first when using AllPages.

Could you try the following:

var query = new Query()
                    .SecurityVulnerabilities(null, null, null, null, SecurityAdvisoryEcosystem.Rubygems, null)
                    .AllPages(100)

jcansdale avatar Feb 06 '20 10:02 jcansdale

Gave it a try, it doesn't impact the behavior at all.

brphelps avatar Feb 07 '20 21:02 brphelps

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

github-actions[bot] avatar Dec 03 '22 01:12 github-actions[bot]