func TenantClientLoader(client *ent.TenantClient, logger log.Logger) TenantLoader {
	if logger == nil {
		logger = log.NewNopLogger()
	}
	return TenantLoaderFunc(func(ctx context.Context, name string) (*ent.Tenant, error) {
		t, err := client.Query().Where(tenant.Name(name)).Only(ctx)
		if err != nil {
			logger.For(ctx).
				Error("loading tenant",
					zap.String("name", name),
					zap.Error(err),
				)
		}
		return t, err
	})
}
// TenantClientLoader creates tenant loader from TenantClient.
TenantClientLoader creates tenant loader from TenantClient.
// TenantClientLoader creates tenant loader from TenantClient .
func TenantClientLoader(client *ent.TenantClient, logger log.Logger) TenantLoader {
	if logger == nil {
		logger = log.NewNopLogger()
	}
	return TenantLoaderFunc(func(ctx context.Context, name string) (*ent.Tenant, error) {
		t, err := client.Query().Where(tenant.Name(name)).Only(ctx)
		if err != nil {
			logger.For(ctx).
				Error("loading tenant",
					zap.String("name", name),
					zap.Error(err),
				)
		}
		return t, err
	})
}
func TenantClientLoader ( client * ent . TenantClient , logger log . Logger ) TenantLoader { if logger == nil { logger = log . NewNopLogger ( ) } return TenantLoaderFunc ( func ( ctx context . Context , name string ) ( * ent . Tenant , error ) { t , err := client . Query ( ) . Where ( tenant . Name ( name ) ) . Only ( ctx ) if err != nil { logger . For ( ctx ) . Error ( " " , zap . String ( " " , name ) , zap . Error ( err ) , ) } return t , err } ) }
TenantClientLoader creates tenant loader from TenantClient.
TenantClientLoader creates tenant loader from TenantClient .