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

Add GetRepos query #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all 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
20 changes: 20 additions & 0 deletions graphql/GetRepos.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
query GetRepos($owner: String!) {
user(login: $owner) {
repositories(last: 100, orderBy: {field: UPDATED_AT, direction: DESC}) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[help]
ページングは after で cursor を文字列で指定するんだけど、hasNext(Prev) が true の場合、
ページングさせたいんだけど、どうやったら良いのかが分からない。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pageInfo {
  hasNextPage,
  hasPreviousPage,
  endCursor,
  startCursor
}

とかにしておいて、引数でend(start)Cursor 位置を受け付けるとかかな?

totalCount
pageInfo {
hasNextPage,
hasPreviousPage
}
edges {
cursor,
node {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他に欲しいものあるかしら?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updatedAt とか使うかも?
最近の更新順で表示したいときとか。

name,
url,
createdAt
}
}
}
}
}