@@ -41,6 +41,7 @@ type PageInfo {
|
||||
type Organization implements Node {
|
||||
id: ID!
|
||||
name: String!
|
||||
logoUrl: String!
|
||||
|
||||
frameworks(
|
||||
first: Int
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
|
||||
5
pkg/probo/coredata/migrations/20250209T183000Z.sql
Normal file
5
pkg/probo/coredata/migrations/20250209T183000Z.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE organizations ADD COLUMN logo_url TEXT;
|
||||
|
||||
UPDATE organizations SET logo_url = 'https://fastly.picsum.photos/id/411/100/100.jpg?grayscale&hmac=lGH1KqiTvm1TFkjJ6kimsgMJIL0S7zVS7EHFi0qOgCk';
|
||||
|
||||
ALTER TABLE organizations ALTER COLUMN logo_url SET NOT NULL;
|
||||
@@ -29,6 +29,7 @@ type (
|
||||
Organization struct {
|
||||
ID gid.GID
|
||||
Name string
|
||||
LogoURL string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
@@ -38,6 +39,7 @@ func (o *Organization) scan(r pgx.Row) error {
|
||||
return r.Scan(
|
||||
&o.ID,
|
||||
&o.Name,
|
||||
&o.LogoURL,
|
||||
&o.CreatedAt,
|
||||
&o.UpdatedAt,
|
||||
)
|
||||
@@ -53,6 +55,7 @@ func (o *Organization) LoadByID(
|
||||
SELECT
|
||||
id,
|
||||
name,
|
||||
logo_url,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
|
||||
Reference in New Issue
Block a user