Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add examples/graphql_issues.rs #478

Merged
merged 1 commit into from
Oct 29, 2023
Merged

Conversation

Enselic
Copy link
Contributor

@Enselic Enselic commented Oct 29, 2023

I could not find any examples of a real graphql query, so here comes one. It would have helped me so hopefully it will also help others.

Example output:

$ GITHUB_TOKEN=github_pat_1234ABC cargo run --example=graphql_issues
Object {
    "data": Object {
        "repository": Object {
            "issues": Object {
                "nodes": Array [
                    Object {
                        "title": String("Add Method For Viewing Repository Traffic Stats  "),
                        "url": String("https://github.com/XAMPPRocky/octocrab/issues/474"),
                    },
                    Object {
                        "title": String("Add API Version configuration to the builder"),
                        "url": String("https://github.com/XAMPPRocky/octocrab/issues/475"),
                    },
                ],
            },
        },
    },
}
$ GITHUB_TOKEN=invalid cargo run --example=graphql_issues
GitHub {
    source: GitHubError {
        documentation_url: Some(
            "https://docs.github.com/graphql",
        ),
        errors: None,
        message: "Bad credentials",
    },
    backtrace: Backtrace(
           0:     0x5641fcb6af8a - backtrace::backtrace::libunwind::trace::h5d71e1a92685bd90
                                       at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/libunwind.rs:93:5
                                   backtrace::backtrace::trace_unsynchronized::h18e9f171dc178e01
                                       at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/mod.rs:66:5
           ...
        ,
    ),

I could not find any examples of a real graphql query, so here comes
one. It would have helped me, so hopefully it will also help others.
@XAMPPRocky
Copy link
Owner

Thank you for your PR, and congrats on your first contribution! 🎉

@XAMPPRocky XAMPPRocky merged commit 463d9ee into XAMPPRocky:main Oct 29, 2023
10 checks passed
@github-actions github-actions bot mentioned this pull request Oct 24, 2023
@Enselic Enselic deleted the graphql_issues branch October 29, 2023 17:20
@github-actions github-actions bot mentioned this pull request Nov 3, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants