CSC/ECE 517-GH-2401-Rest-GraphQL-Endpoints

From Expertiza_Wiki
Revision as of 23:26, 24 March 2024 by Opjain (talk | contribs)
Jump to navigation Jump to search

About

The project involves developing API endpoints for GitHub GraphQL queries and GitHub REST queries and to integrate these endpoints into the Python Flask framework, enabling the publication of these queries as accessible API endpoints via URLs. We have implemented endpoints for 4 query elements: comment, contributions, profiles and time_range_contributions. Each element contains multiple queries and each query has a separate endpoints for both GraphQL and REST API implemented.

Setup

Endpoints

Comments

User Gists

This query returns the comments in gists of the authenticated user.

GraphQL Endpoint

'/api/graphql/user-gist-comments/'

REST Endpoint

'/api/rest/user-gist-comments/'

User Commits

This query returns the comments in all commits of the authenticated user.

GraphQL Endpoint

'/api/graphql/user-commit-comments/'

REST Endpoint

'/api/rest/user-commit-comments/'

User Issues

This query returns the comments in issues and pull requests of all public repositories of the authenticated user.

GraphQL Endpoint

'/api/graphql/user-issue-comments'

REST Endpoint

'/api/rest/user-issue-comments'

User Repository Discussions

This query returns the comments in the repository discussions of the authenticated user. For the REST query, there is no REST query to fetch repository discussions, hence this endpoint does not return any results.

GraphQL Endpoint

'/api/graphql/user-repository-discussions'

Contributions

User Gists

This query returns the gists of the authenticated user.

GraphQL Endpoint

'/api/graphql/user-gists/<username>'

REST Endpoint

'/api/rest/user-gists/<username>'

User Issues

This query returns the issues of the authenticated user.

GraphQL Endpoint

'/api/graphql/user-issues/<username>'

REST Endpoint

'/api/rest/user-issues/<username>'


User Pull Requests

This query returns the pull requests of the authenticated user. For the REST query, we can only fetch pull requests for a particular repository for the authenticated user.

GraphQL Endpoint

'/api/graphql/user-pull-requests/<username>'

REST Endpoint

'/api/rest/user-pull-requests/<username>/<repo>'

User Repositories

This query returns the repositories of the authenticated user.

GraphQL Endpoint

'/api/graphql/user-repositories/<username>'

REST Endpoint

'/api/rest/user-repositories/<username>'

User Repository Discussions

This query returns the repository discussions of the authenticated user. For the REST query, there is no REST query to fetch repository discussions, hence this endpoint does not return any results.

GraphQL Endpoint

'/api/graphql/user-repository-discussions/<username>'

REST Endpoint

'/api/rest/repository-discussions/<username>/<repo>'

Profiles

This endpoint returns all the profile statistics (followers, gists, issues, pull requests, repositories, etc.) of the required user. The user must specify the username in this query.

GraphQL Endpoint

'/api/graphql/user-stats/<username>'

REST Endpoint

'/api/rest/user-stats/<username>'

Time Range Contributions

This endpoint returns all the details of the user contributions within a specified duration. The user must specify the username, start date, and end date in this query.

GraphQL Endpoint

'/api/graphql/user-contributions/<username>'

REST Endpoint

'/api/rest/user-contributions/<username>'


Query Params

start: DateTime (ISO 8601 format) end: DateTime (ISO 8601 format)