Skip to content

GraphQL usage with githubkit #132

@marckhair

Description

@marckhair

Hey,

I am writing my first GraphQL queries with githubkit. Do you see anything wrong with my usage? I can't seem to get my queries to work. The queries are successful in my GraphQL explorer.

async with GitHub(
    github_token, base_url="https://<myenterprisegithuburl>.com/api/graphql"
) as github_client:

    resp = await github_client.async_graphql(
        query="""
            query myQuery($owner: String!, $name: String!) {
                repository(owner: $owner, name: $name){
                    id
                }
            }
        """,
        variables={
            "owner": owner,
            "name": repo
        }
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    GraphQLquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions