import json


def get_rate_limit(client):
    """
    Get the Github API rate limit current state for the used token
    """
    query = '''query {
        rateLimit {
            limit
            remaining
            resetAt
        }
    }'''
    response = client.execute(query)
    json_response = json.loads(response)
    return json_response['data']['rateLimit']