-
Notifications
You must be signed in to change notification settings - Fork 50
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
Cannot retrieve IGitObject which is a Union in correct object type #195
Comments
Well, if you're using the latest nuget package I don't think they have published the commit with the Union Types - looks like the last version was end of October, and union types were merged November. However, in the code I still don't think they have a Selector on that IGitObject. The same is true of I don't actually see how you would identify what type of owner you got back using this library, outside of guess-and-check users and if it errors, check orgs. Am I missing something? Is there a simple way of returning |
👋 Hey Friends, this issue has been automatically marked as |
Summary
Depending how a GitHub Release is created, a Release.Tag.Target can either refer to a Commit object or to a Tag object. To retrieve the target Sha1 of the Release, inline fragments are required in a GraphQL query.
It doesn't currently seem possible to reproduce this using the Octokit.GraphQL library as the Switch<> syntax is not available on Target's object type (which is IGitObject), nor on it's parent Tag's object type (which is Ref ... just in case there was syntactic sugar going on somewhere).
Relevant information
Here's some GraphQL that reproduces this:
Please note that I am unable to provide you with a public example of this in the real world as I'm using GitHub Enterprise. However here is a (redacted) version of the results when this is run against my server:
Based on your documentation, this is some pseudo code of what I would expect to be able to do:
I've had a look through the library code and as far as I can tell it's isn't supported. However, feel free to let me know if it's a PEBKAC error!
Thanks for reading.
The text was updated successfully, but these errors were encountered: