Skip to content

Commit

Permalink
Merge pull request #29 from ioedeveloper/viewer-query
Browse files Browse the repository at this point in the history
Viewer query
  • Loading branch information
ioedeveloper authored Mar 19, 2021
2 parents 3f797db + ebf9cad commit 47da4f0
Show file tree
Hide file tree
Showing 4 changed files with 2,360 additions and 170 deletions.
155 changes: 142 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 9 additions & 68 deletions src/queries.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,16 @@
export * from "./user"

/**
* @description Github Graphql Query for viewer details
* @description Github Graphql Query for Viewer
* @fields User
*/
export const Viewer = `
export const Viewer = (fields: string) => `
query {
viewer {
id
email
login
url
createdAt
updatedAt
databaseId
location
companyHTML
company
avatarUrl
bio
websiteUrl
isHireable
isDeveloperProgramMember
anyPinnableItems
isSiteAdmin
isViewer
viewerCanFollow
viewerIsFollowing
viewerCanCreateProjects
isEmployee
isBountyHunter
isCampusExpert
pinnedItemsRemaining
projectsUrl
}
viewer {
${fields}
}
}
`
`;

/**
* @description Github Graphql Query for repository content (files and directories)
Expand Down Expand Up @@ -892,43 +870,6 @@ export const ViewerFollowers = `
}
`

/**
* @description Github Graphql Query for Github User
* @queryVariable username: String!
*/
export const User = `
query($username: String!){
user(login: $username){
id
email
login
url
createdAt
updatedAt
databaseId
location
companyHTML
company
avatarUrl
bio
websiteUrl
isHireable
isDeveloperProgramMember
anyPinnableItems
isSiteAdmin
isViewer
viewerCanFollow
viewerIsFollowing
viewerCanCreateProjects
isEmployee
isBountyHunter
isCampusExpert
pinnedItemsRemaining
projectsUrl
}
}
`

/**
* @description Github Graphql Query for All User Repositories
* @queryVariable username: String! first: Int!
Expand Down
Loading

0 comments on commit 47da4f0

Please sign in to comment.