35 lines
1.0 KiB
Go
35 lines
1.0 KiB
Go
package console_v1
|
|
|
|
// This file will be automatically regenerated based on the schema, any resolver
|
|
// implementations
|
|
// will be copied through when generating and any unknown code will be moved to the end.
|
|
// Code generated by github.com/99designs/gqlgen version v0.17.94
|
|
|
|
import (
|
|
"context"
|
|
|
|
"go.probo.inc/probo/pkg/probo"
|
|
"go.probo.inc/probo/pkg/server/api/console/v1/schema"
|
|
"go.probo.inc/probo/pkg/server/api/console/v1/types"
|
|
)
|
|
|
|
// Logo is the resolver for the logo field.
|
|
func (r *commonThirdPartyResolver) Logo(ctx context.Context, obj *types.CommonThirdParty) (*types.File, error) {
|
|
if _, err := r.authorize(ctx, obj.ID, probo.ActionCommonThirdPartyGet); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if obj.Logo == nil {
|
|
return nil, nil
|
|
}
|
|
|
|
return r.loadFile(ctx, obj.Logo.ID)
|
|
}
|
|
|
|
// CommonThirdParty returns schema.CommonThirdPartyResolver implementation.
|
|
func (r *Resolver) CommonThirdParty() schema.CommonThirdPartyResolver {
|
|
return &commonThirdPartyResolver{r}
|
|
}
|
|
|
|
type commonThirdPartyResolver struct{ *Resolver }
|