From 7df170939f2bad0f03b834dda5af1b55bd0d6830 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 4 Sep 2019 21:04:05 +0200 Subject: graphql: make repository.validLabels a connection --- graphql/schema/label.graphql | 19 +++++++++++++++++++ graphql/schema/repository.graphql | 11 ++++++++++- graphql/schema/types.graphql | 8 -------- 3 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 graphql/schema/label.graphql (limited to 'graphql/schema') 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?""" -- cgit