diff options
author | Michael Muré <batolettre@gmail.com> | 2020-02-26 07:38:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 07:38:13 +0100 |
commit | 0c791483286ce2ed845bbc77b2a2899149ad83c5 (patch) | |
tree | 6129d0a6e2efbfa81b26534ee5aeb65ba1261bfe /graphql/graph | |
parent | 68acfa519ab6656648d1e976db2a4190bbeb5f44 (diff) | |
parent | 893de4f5c0e852fac9a73e0c0243bc038af75f17 (diff) | |
download | git-bug-0c791483286ce2ed845bbc77b2a2899149ad83c5.tar.gz |
Merge pull request #343 from MichaelMure/login-is-back
identity: bring back the login to hold that info from bridges
Diffstat (limited to 'graphql/graph')
-rw-r--r-- | graphql/graph/gen_graph.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/graphql/graph/gen_graph.go b/graphql/graph/gen_graph.go index 5c84dae1..277cb7cb 100644 --- a/graphql/graph/gen_graph.go +++ b/graphql/graph/gen_graph.go @@ -200,6 +200,7 @@ 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 } @@ -1100,6 +1101,13 @@ 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 @@ -1941,6 +1949,8 @@ type Identity { name: String """The email of the person, if known.""" email: String + """The login of the person, if known.""" + login: String """A non-empty string to display, representing the identity, based on the non-empty values.""" displayName: String! """An url to an avatar""" @@ -5711,6 +5721,37 @@ 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 models.IdentityWrapper) (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() + }) + 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 models.IdentityWrapper) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { @@ -11256,6 +11297,8 @@ 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 { |