Add notable contributions plugin (#222)

This commit is contained in:
Simon Lecoq
2021-04-09 20:51:45 +02:00
committed by GitHub
parent e63dee0c6e
commit 19bb1b3766
15 changed files with 218 additions and 4 deletions

View File

@@ -0,0 +1,28 @@
/**Mocked data */
export default function({faker, query, login = faker.internet.userName()}) {
console.debug("metrics/compute/mocks > mocking graphql api result > notable/contributions")
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
user:{
repositoriesContributedTo:{
edges:[],
},
},
}) : ({
user:{
repositoriesContributedTo:{
edges:[
{
cursor:"MOCKED_CURSOR",
node:{
isInOrganization:true,
owner:{
login:faker.internet.userName(),
avatarUrl:null,
},
},
},
],
},
},
})
}

View File

@@ -0,0 +1,14 @@
/**Mocked data */
export default function({faker, query, login = faker.internet.userName()}) {
console.debug("metrics/compute/mocks > mocking graphql api result > notable/organizations")
return ({
user:{
organizations:{
nodes:[{
login:faker.internet.userName(),
avatarUrl:null,
}],
},
},
})
}