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

Please provide a get commit example #217

Open
jjxtra opened this issue Feb 23, 2020 · 5 comments
Open

Please provide a get commit example #217

jjxtra opened this issue Feb 23, 2020 · 5 comments
Labels
Type: Documentation Improvements or additions to documentation Type: Support Any questions, information, or general needs around the SDK or GitHub APIs

Comments

@jjxtra
Copy link

jjxtra commented Feb 23, 2020

Please provide an example in your documentation on how to get all commits from a repo and branch... this is very difficult to figure out right now.

var commitsQuery = new Octokit.GraphQL.Query().Repository(Var(repo.Name), Var(orgName))
.DefaultBranchRef.Target.???

@jjxtra
Copy link
Author

jjxtra commented Feb 23, 2020

Took me a day but I got something working...

var commitsQuery = new Octokit.GraphQL.Query().Repository(new Octokit.GraphQL.Core.Arg<string>(repo.Name),
    new Octokit.GraphQL.Core.Arg<string>(orgName))
    .DefaultBranchRef.Target.Cast<Octokit.GraphQL.Model.Commit>().History().Nodes.Select(commit =>
        new Model.Commit
        {
            Hash = commit.Oid,
            LinesAdded = commit.Additions,
            LinesDeleted = commit.Deletions,
            Timestamp = commit.PushedDate,
            UserName = commit.Committer.User.Login
        }
    );

@PolarizedIons
Copy link

Has someone gotten the since parameter in the History() call working? I get the following if I put it in a variable:

Unhandled exception. Octokit.GraphQL.Core.Deserializers.ResponseDeserializerException: Type mismatch on variable $since and argument since (String / GitTimestamp)

but it works fine if I "hard-code" it

@nickfloyd
Copy link
Contributor

Hey @PolarizedIons,

Thanks for reaching out, and sorry for the trouble that you're running into. Given that your issue is a bit different from what @jjxtra originally posted, would you mind creating a new issue for us to track the problem that you are running into with (or I'd be glad to create one for you)?

Also, please provide any code, samples, etc.. that will help us reproduce the issue so we can help you more quickly.

@nickfloyd nickfloyd added Type: Support Any questions, information, or general needs around the SDK or GitHub APIs Type: Documentation Improvements or additions to documentation and removed question labels Oct 26, 2022
@nikhil4dhiman
Copy link

Has someone gotten the since parameter in the History() call working? I get the following if I put it in a variable:

Unhandled exception. Octokit.GraphQL.Core.Deserializers.ResponseDeserializerException: Type mismatch on variable $since and argument since (String / GitTimestamp)

but it works fine if I "hard-code" it
Hi @PolarizedIons

Did you find any resolution for this ?

@kfcampbell kfcampbell moved this to 🆕 Triage in 🧰 Octokit Active Feb 14, 2024
@kfcampbell kfcampbell moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Feb 14, 2024
@guilhermemoschenehps
Copy link

Searching at the repository, here the since and until should be of type Arg<DateTimeOffset>?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Improvements or additions to documentation Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

5 participants