GraphQL APi too slow


#1

Hi,
I am using the following GraphQL query "
{
viewer {
repositories(first: 100, affiliations: [OWNER, COLLABORATOR, ORGANIZATION_MEMBER], orderBy: {field: PUSHED_AT, direction: DESC}) {
totalCount
edges {
node {
name
owner {
login
}
url
pushedAt
description
pullRequests(states: OPEN) {
totalCount
}
issues(states: OPEN) {
totalCount
}
refs(refPrefix: “refs/heads/”) {
totalCount
}
}
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
I tried it on GraphQL Explorer and it took around 5 seconds.. Thats too much if i am building a web application and want to display the result to a user…
Is there any way to optimize it ?

Also i noticed that if i use the line :
repositories(first: 100)
that is without the order by and affiliations tag then it takes only around 1 seconds…

Thanks