Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewer query #29

Merged
merged 5 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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