aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/schema
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-09-04 21:04:05 +0200
committerMichael Muré <batolettre@gmail.com>2019-09-04 21:04:05 +0200
commit7df170939f2bad0f03b834dda5af1b55bd0d6830 (patch)
tree923011eb7e421c44cb6bcec4f1f5806066c51264 /graphql/schema
parent16af70894c0348ec90dfee69274f7d44ef2eb079 (diff)
downloadgit-bug-7df170939f2bad0f03b834dda5af1b55bd0d6830.tar.gz
graphql: make repository.validLabels a connection
Diffstat (limited to 'graphql/schema')
-rw-r--r--graphql/schema/label.graphql19
-rw-r--r--graphql/schema/repository.graphql11
-rw-r--r--graphql/schema/types.graphql8
3 files changed, 29 insertions, 9 deletions
diff --git a/graphql/schema/label.graphql b/graphql/schema/label.graphql
new file mode 100644
index 00000000..1205915c
--- /dev/null
+++ b/graphql/schema/label.graphql
@@ -0,0 +1,19 @@
+"""Label for a bug."""
+type Label {
+ """The name of the label."""
+ name: String!
+ """Color of the label."""
+ color: Color!
+}
+
+type LabelConnection {
+ edges: [LabelEdge!]!
+ nodes: [Label!]!
+ pageInfo: PageInfo!
+ totalCount: Int!
+}
+
+type LabelEdge {
+ cursor: String!
+ node: Label!
+} \ No newline at end of file
diff --git a/graphql/schema/repository.graphql b/graphql/schema/repository.graphql
index 0fb491e0..20a3cf0b 100644
--- a/graphql/schema/repository.graphql
+++ b/graphql/schema/repository.graphql
@@ -34,5 +34,14 @@ type Repository {
userIdentity: Identity
"""List of valid labels."""
- validLabels: [Label!]!
+ validLabels(
+ """Returns the elements in the list that come after the specified cursor."""
+ after: String
+ """Returns the elements in the list that come before the specified cursor."""
+ before: String
+ """Returns the first _n_ elements from the list."""
+ first: Int
+ """Returns the last _n_ elements from the list."""
+ last: Int
+ ): LabelConnection!
} \ No newline at end of file
diff --git a/graphql/schema/types.graphql b/graphql/schema/types.graphql
index fb94d1e8..0182885e 100644
--- a/graphql/schema/types.graphql
+++ b/graphql/schema/types.graphql
@@ -11,14 +11,6 @@ type Color {
B: Int!
}
-"""Label for a bug."""
-type Label {
- """The name of the label."""
- name: String!
- """Color of the label."""
- color: Color!
-}
-
"""Information about pagination in a connection."""
type PageInfo {
"""When paginating forwards, are there more items?"""