aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/schema
diff options
context:
space:
mode:
authorMichael Muré <michael.mure@consensys.net>2019-03-31 21:44:14 +0200
committerMichael Muré <batolettre@gmail.com>2019-04-01 14:03:13 +0200
commit15c258cdc4ba37820362a44dfc2636ed1ff92b4c (patch)
tree0790e36bf4846b12b367f12670540eec6ee023f3 /graphql/schema
parente028b895aa21553937d732044b7bb0a15c5276f6 (diff)
downloadgit-bug-15c258cdc4ba37820362a44dfc2636ed1ff92b4c.tar.gz
graphql: expose allIdentities, identities and userIdentity in the repo
Diffstat (limited to 'graphql/schema')
-rw-r--r--graphql/schema/bug.graphql17
-rw-r--r--graphql/schema/identity.graphql14
-rw-r--r--graphql/schema/repository.graphql35
-rw-r--r--graphql/schema/root.graphql22
-rw-r--r--graphql/schema/types.graphql21
5 files changed, 72 insertions, 37 deletions
diff --git a/graphql/schema/bug.graphql b/graphql/schema/bug.graphql
index 7e1c57b5..a1a61e7e 100644
--- a/graphql/schema/bug.graphql
+++ b/graphql/schema/bug.graphql
@@ -28,7 +28,9 @@ enum Status {
}
type Bug {
+ """The identifier for this bug"""
id: String!
+ """The human version (truncated) identifier for this bug"""
humanId: String!
status: Status!
title: String!
@@ -90,18 +92,3 @@ type BugEdge {
node: Bug!
}
-type Repository {
- allBugs(
- """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
- """A query to select and order bugs"""
- query: String
- ): BugConnection!
- bug(prefix: String!): Bug
-}
diff --git a/graphql/schema/identity.graphql b/graphql/schema/identity.graphql
index 18666f76..6872ecb9 100644
--- a/graphql/schema/identity.graphql
+++ b/graphql/schema/identity.graphql
@@ -2,6 +2,8 @@
type Identity {
"""The identifier for this identity"""
id: String!
+ """The human version (truncated) identifier for this identity"""
+ humanId: String!
"""The name of the person, if known."""
name: String
"""The email of the person, if known."""
@@ -16,3 +18,15 @@ type Identity {
If that's the case, only signed commit with a valid key for this identity can be added."""
isProtected: Boolean!
}
+
+type IdentityConnection {
+ edges: [IdentityEdge!]!
+ nodes: [Identity!]!
+ pageInfo: PageInfo!
+ totalCount: Int!
+}
+
+type IdentityEdge {
+ cursor: String!
+ node: Identity!
+} \ No newline at end of file
diff --git a/graphql/schema/repository.graphql b/graphql/schema/repository.graphql
new file mode 100644
index 00000000..a4f4b424
--- /dev/null
+++ b/graphql/schema/repository.graphql
@@ -0,0 +1,35 @@
+
+type Repository {
+ """All the bugs"""
+ allBugs(
+ """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
+ """A query to select and order bugs"""
+ query: String
+ ): BugConnection!
+
+ bug(prefix: String!): Bug
+
+ """All the identities"""
+ allIdentities(
+ """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
+ ): IdentityConnection!
+
+ identity(prefix: String!):Identity
+
+ """The identity created or selected by the user as its own"""
+ userIdentity:Identity
+} \ No newline at end of file
diff --git a/graphql/schema/root.graphql b/graphql/schema/root.graphql
index 7b43366f..2d430aa5 100644
--- a/graphql/schema/root.graphql
+++ b/graphql/schema/root.graphql
@@ -1,25 +1,3 @@
-scalar Time
-scalar Label
-scalar Hash
-
-"""Information about pagination in a connection."""
-type PageInfo {
- """When paginating forwards, are there more items?"""
- hasNextPage: Boolean!
- """When paginating backwards, are there more items?"""
- hasPreviousPage: Boolean!
- """When paginating backwards, the cursor to continue."""
- startCursor: String!
- """When paginating forwards, the cursor to continue."""
- endCursor: String!
-}
-
-"""An object that has an author."""
-interface Authored {
- """The author of this object."""
- author: Identity!
-}
-
type Query {
defaultRepository: Repository
repository(id: String!): Repository
diff --git a/graphql/schema/types.graphql b/graphql/schema/types.graphql
new file mode 100644
index 00000000..2eaa07a2
--- /dev/null
+++ b/graphql/schema/types.graphql
@@ -0,0 +1,21 @@
+scalar Time
+scalar Label
+scalar Hash
+
+"""Information about pagination in a connection."""
+type PageInfo {
+ """When paginating forwards, are there more items?"""
+ hasNextPage: Boolean!
+ """When paginating backwards, are there more items?"""
+ hasPreviousPage: Boolean!
+ """When paginating backwards, the cursor to continue."""
+ startCursor: String!
+ """When paginating forwards, the cursor to continue."""
+ endCursor: String!
+}
+
+"""An object that has an author."""
+interface Authored {
+ """The author of this object."""
+ author: Identity!
+} \ No newline at end of file