query projects($cursor: Cursor) {
    me {
        projects(cursor: $cursor) {
            ...projects
        }
    }
}

query projectsByUser($username: String!, $cursor: Cursor) {
    user(username: $username) {
        projects(cursor: $cursor) {
            ...projects
        }
    }
}

fragment projects on ProjectCursor {
    results {
        name
        description
        tags
        visibility
    }
    cursor
}

query projectByName($name: String!) {
    me {
        project(name: $name) {
            ...projectDetails
        }
    }
}

query projectByUser($username: String!, $name: String!) {
    user(username: $username) {
        project(name: $name) {
            ...projectDetails
        }
    }
}

fragment projectDetails on Project {
    rid
    name
    description
    website
    visibility
    tags
    owner {
        canonicalName
    }
    mailingLists {
        cursor
        results {
            rid
            name
            description
            visibility
        }
    }
    sources {
        cursor
        results {
            rid
            name
            repoType
            description
            visibility
        }
    }
    trackers {
        cursor
        results {
            rid
            name
            description
            visibility
        }
    }
}
