aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/graphql_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-04-05 01:13:17 +0200
committerMichael Muré <batolettre@gmail.com>2019-04-05 01:13:17 +0200
commite027d5ee65aad72ca7cface8e609ea0c65f99fbe (patch)
tree3b67170e86c4158dd2dd4f23f3013641505dac35 /graphql/graphql_test.go
parentb9e413c5f95212a0076aae0f473226b32b5fc77a (diff)
downloadgit-bug-e027d5ee65aad72ca7cface8e609ea0c65f99fbe.tar.gz
graphql: make Bug's actors and participants a connection
Diffstat (limited to 'graphql/graphql_test.go')
-rw-r--r--graphql/graphql_test.go75
1 files changed, 53 insertions, 22 deletions
diff --git a/graphql/graphql_test.go b/graphql/graphql_test.go
index 0b522b5e..eef8df3d 100644
--- a/graphql/graphql_test.go
+++ b/graphql/graphql_test.go
@@ -50,16 +50,6 @@ func TestQueries(t *testing.T) {
email
avatarUrl
}
- actors {
- name
- email
- avatarUrl
- }
- participants {
- name
- email
- avatarUrl
- }
createdAt
humanId
@@ -67,6 +57,36 @@ func TestQueries(t *testing.T) {
lastEdit
status
title
+
+ actors(first: 10) {
+ pageInfo {
+ endCursor
+ hasNextPage
+ startCursor
+ hasPreviousPage
+ }
+ nodes {
+ id
+ humanId
+ name
+ displayName
+ }
+ }
+
+ participants(first: 10) {
+ pageInfo {
+ endCursor
+ hasNextPage
+ startCursor
+ hasPreviousPage
+ }
+ nodes {
+ id
+ humanId
+ name
+ displayName
+ }
+ }
comments(first: 2) {
pageInfo {
@@ -123,9 +143,12 @@ func TestQueries(t *testing.T) {
}`
type Identity struct {
- Name string `json:"name"`
- Email string `json:"email"`
- AvatarUrl string `json:"avatarUrl"`
+ Id string `json:"id"`
+ HumanId string `json:"humanId"`
+ Name string `json:"name"`
+ Email string `json:"email"`
+ AvatarUrl string `json:"avatarUrl"`
+ DisplayName string `json:"displayName"`
}
var resp struct {
@@ -133,15 +156,23 @@ func TestQueries(t *testing.T) {
AllBugs struct {
PageInfo models.PageInfo
Nodes []struct {
- Author Identity
- Actors []Identity
- Participants []Identity
- CreatedAt string `json:"createdAt"`
- HumanId string `json:"humanId"`
- Id string
- LastEdit string `json:"lastEdit"`
- Status string
- Title string
+ Author Identity
+ CreatedAt string `json:"createdAt"`
+ HumanId string `json:"humanId"`
+ Id string
+ LastEdit string `json:"lastEdit"`
+ Status string
+ Title string
+
+ Actors struct {
+ PageInfo models.PageInfo
+ Nodes []Identity
+ }
+
+ Participants struct {
+ PageInfo models.PageInfo
+ Nodes []Identity
+ }
Comments struct {
PageInfo models.PageInfo