aboutsummaryrefslogtreecommitdiffstats
path: root/graphql
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-09 01:31:00 +0100
committerGitHub <noreply@github.com>2020-02-09 01:31:00 +0100
commit9e1a987b4d94dc5c2115423ede5954d4faf1d342 (patch)
treee30bb28d55444a7d1e66c8fa8b8ba7d413805473 /graphql
parent97bc5ccd229b7b438262a84e3c42783b4d4a82af (diff)
parent9b1aaa032d36e1ac05504916e359f767d1622d9d (diff)
downloadgit-bug-9e1a987b4d94dc5c2115423ede5954d4faf1d342.tar.gz
Merge pull request #294 from MichaelMure/cred-metadata
Cred metadata
Diffstat (limited to 'graphql')
-rw-r--r--graphql/graph/gen_graph.go47
-rw-r--r--graphql/resolvers/identity.go3
-rw-r--r--graphql/schema/identity.graphql4
-rw-r--r--graphql/schema/root.graphql2
4 files changed, 6 insertions, 50 deletions
diff --git a/graphql/graph/gen_graph.go b/graphql/graph/gen_graph.go
index 215603cb..5e882142 100644
--- a/graphql/graph/gen_graph.go
+++ b/graphql/graph/gen_graph.go
@@ -210,7 +210,6 @@ type ComplexityRoot struct {
HumanID func(childComplexity int) int
ID func(childComplexity int) int
IsProtected func(childComplexity int) int
- Login func(childComplexity int) int
Name func(childComplexity int) int
}
@@ -1139,13 +1138,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return e.complexity.Identity.IsProtected(childComplexity), true
- case "Identity.login":
- if e.complexity.Identity.Login == nil {
- break
- }
-
- return e.complexity.Identity.Login(childComplexity), true
-
case "Identity.name":
if e.complexity.Identity.Name == nil {
break
@@ -2319,11 +2311,7 @@ type Identity {
"""
email: String
"""
- The login of the person, if known.
- """
- login: String
- """
- A string containing the either the name of the person, its login or both
+ A non-empty string to display, representing the identity, based on the non-empty values.
"""
displayName: String!
"""
@@ -6215,37 +6203,6 @@ func (ec *executionContext) _Identity_email(ctx context.Context, field graphql.C
return ec.marshalOString2string(ctx, field.Selections, res)
}
-func (ec *executionContext) _Identity_login(ctx context.Context, field graphql.CollectedField, obj identity.Interface) (ret graphql.Marshaler) {
- defer func() {
- if r := recover(); r != nil {
- ec.Error(ctx, ec.Recover(ctx, r))
- ret = graphql.Null
- }
- }()
- fc := &graphql.FieldContext{
- Object: "Identity",
- Field: field,
- Args: nil,
- IsMethod: true,
- }
-
- ctx = graphql.WithFieldContext(ctx, fc)
- resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
- ctx = rctx // use context from middleware stack in children
- return obj.Login(), nil
- })
- if err != nil {
- ec.Error(ctx, err)
- return graphql.Null
- }
- if resTmp == nil {
- return graphql.Null
- }
- res := resTmp.(string)
- fc.Result = res
- return ec.marshalOString2string(ctx, field.Selections, res)
-}
-
func (ec *executionContext) _Identity_displayName(ctx context.Context, field graphql.CollectedField, obj identity.Interface) (ret graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
@@ -11946,8 +11903,6 @@ func (ec *executionContext) _Identity(ctx context.Context, sel ast.SelectionSet,
out.Values[i] = ec._Identity_name(ctx, field, obj)
case "email":
out.Values[i] = ec._Identity_email(ctx, field, obj)
- case "login":
- out.Values[i] = ec._Identity_login(ctx, field, obj)
case "displayName":
out.Values[i] = ec._Identity_displayName(ctx, field, obj)
if out.Values[i] == graphql.Null {
diff --git a/graphql/resolvers/identity.go b/graphql/resolvers/identity.go
index da8e7b08..d36669d0 100644
--- a/graphql/resolvers/identity.go
+++ b/graphql/resolvers/identity.go
@@ -15,6 +15,7 @@ func (identityResolver) ID(ctx context.Context, obj identity.Interface) (string,
return obj.Id().String(), nil
}
-func (identityResolver) HumanID(ctx context.Context, obj identity.Interface) (string, error) {
+func (r identityResolver) HumanID(ctx context.Context, obj identity.Interface) (string, error) {
return obj.Id().Human(), nil
+
}
diff --git a/graphql/schema/identity.graphql b/graphql/schema/identity.graphql
index 6872ecb9..6490d538 100644
--- a/graphql/schema/identity.graphql
+++ b/graphql/schema/identity.graphql
@@ -8,9 +8,7 @@ type Identity {
name: String
"""The email of the person, if known."""
email: String
- """The login of the person, if known."""
- login: String
- """A string containing the either the name of the person, its login or both"""
+ """A non-empty string to display, representing the identity, based on the non-empty values."""
displayName: String!
"""An url to an avatar"""
avatarUrl: String
diff --git a/graphql/schema/root.graphql b/graphql/schema/root.graphql
index f66272ca..2a12cc37 100644
--- a/graphql/schema/root.graphql
+++ b/graphql/schema/root.graphql
@@ -3,6 +3,8 @@ type Query {
defaultRepository: Repository
"""Access a repository by reference/name."""
repository(ref: String!): Repository
+
+ #TODO: connection for all repositories
}
type Mutation {