Skip to content

Commit

Permalink
feat: support for DependencyGraph in graphql API
Browse files Browse the repository at this point in the history
  • Loading branch information
user2589 committed Oct 11, 2020
1 parent fdd6a72 commit 5a7d7a7
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions stscraper/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
from .base import *
import stutils

# This is a list of preview features
# https://developer.github.com/v3/previews/
# https://developer.github.com/v4/previews
accept_headers = (
# v3 repository topics
'application/vnd.github.mercy-preview+json,'
# v3 reactions
'application/vnd.github.squirrel-girl-preview,'
# project event details
'application/vnd.github.starfox-preview+json,'
# dependency graph access
'application/vnd.github.hawkgirl-preview+json'
)


class GitHubAPIToken(APIToken):
api_url = 'https://api.github.com/'
Expand All @@ -25,10 +39,7 @@ def __init__(self, token=None, timeout=None):
# mercy-preview: repo topics
# squirrel-girl-preview: issue reactions
# starfox-preview: issue events
self._headers = {
'Accept': 'application/vnd.github.mercy-preview+json,'
'application/vnd.github.squirrel-girl-preview,'
'application/vnd.github.starfox-preview+json'}
self._headers = {'Accept': accept_headers}
if token is not None:
self.token = token
self._headers['Authorization'] = 'token ' + token
Expand Down

0 comments on commit 5a7d7a7

Please sign in to comment.