Add console layout

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-02-09 18:48:42 -08:00
parent e8c1990224
commit b10f48998d
32 changed files with 3030 additions and 28 deletions

View File

@@ -41,6 +41,7 @@ type PageInfo {
type Organization implements Node {
id: ID!
name: String!
logoUrl: String!
frameworks(
first: Int

View File

@@ -156,6 +156,7 @@ type ComplexityRoot struct {
CreatedAt func(childComplexity int) int
Frameworks func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey) int
ID func(childComplexity int) int
LogoURL func(childComplexity int) int
Name func(childComplexity int) int
Peoples func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey) int
UpdatedAt func(childComplexity int) int
@@ -716,6 +717,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return e.complexity.Organization.ID(childComplexity), true
case "Organization.logoUrl":
if e.complexity.Organization.LogoURL == nil {
break
}
return e.complexity.Organization.LogoURL(childComplexity), true
case "Organization.name":
if e.complexity.Organization.Name == nil {
break
@@ -1216,6 +1224,7 @@ type PageInfo {
type Organization implements Node {
id: ID!
name: String!
logoUrl: String!
frameworks(
first: Int
@@ -4579,6 +4588,44 @@ func (ec *executionContext) fieldContext_Organization_name(_ context.Context, fi
return fc, nil
}
func (ec *executionContext) _Organization_logoUrl(ctx context.Context, field graphql.CollectedField, obj *types.Organization) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Organization_logoUrl(ctx, field)
if err != nil {
return graphql.Null
}
ctx = graphql.WithFieldContext(ctx, fc)
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
ctx = rctx // use context from middleware stack in children
return obj.LogoURL, nil
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
if !graphql.HasFieldError(ctx, fc) {
ec.Errorf(ctx, "must not be null")
}
return graphql.Null
}
res := resTmp.(string)
fc.Result = res
return ec.marshalNString2string(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Organization_logoUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Organization",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Organization_frameworks(ctx context.Context, field graphql.CollectedField, obj *types.Organization) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Organization_frameworks(ctx, field)
if err != nil {
@@ -9268,6 +9315,11 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection
if out.Values[i] == graphql.Null {
atomic.AddUint32(&out.Invalids, 1)
}
case "logoUrl":
out.Values[i] = ec._Organization_logoUrl(ctx, field, obj)
if out.Values[i] == graphql.Null {
atomic.AddUint32(&out.Invalids, 1)
}
case "frameworks":
field := field

View File

@@ -22,6 +22,7 @@ func NewOrganization(o *coredata.Organization) *Organization {
return &Organization{
ID: o.ID,
Name: o.Name,
LogoURL: o.LogoURL,
CreatedAt: o.CreatedAt,
UpdatedAt: o.UpdatedAt,
}

View File

@@ -128,6 +128,7 @@ type FrameworkEdge struct {
type Organization struct {
ID gid.GID `json:"id"`
Name string `json:"name"`
LogoURL string `json:"logoUrl"`
Frameworks *FrameworkConnection `json:"frameworks"`
Vendors *VendorConnection `json:"vendors"`
Peoples *PeopleConnection `json:"peoples"`