PHPackages                             ynloultratech/graphql-media-service - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ynloultratech/graphql-media-service

AbandonedArchivedSymfony-bundle[API Development](/categories/api)

ynloultratech/graphql-media-service
===================================

Serve and manage files using a GraphQL API

1.1.1(6y ago)010.9kMITPHPPHP ^7.1.3

Since Feb 26Pushed 4y ago2 watchersCompare

[ Source](https://github.com/ynloultratech/graphql-media-service)[ Packagist](https://packagist.org/packages/ynloultratech/graphql-media-service)[ RSS](/packages/ynloultratech-graphql-media-service/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (25)Versions (5)Used By (0)

graphql-media-service
=====================

[](#graphql-media-service)

To build your application you probably need images, video's or maybe even a presentation too. The GraphQL Media Service handles all those media assets and centralizes them so you can find your content just the way you like it: fast and efficiently.

- Single endpoint to upload your files trough a API.
- GraphQL Object for files to get details and download url.
- Public and Private files using signed urls
- Direct relations between files and entities

Installation
------------

[](#installation)

Install using composer:

```
composer require graphql-media-service

```

How its works?
--------------

[](#how-its-works)

Usage
-----

[](#usage)

> The following steps assume you have a configured GraphQLAPI using [graphql-bundle](https://github.com/ynloultratech/graphql-bundle).

Add the following config in your `config.yml`

```
#config.yml

media_service:
    class: AppBundle\Entity\File
    default_storage: public_files
    storage:
       public_files:
          local:
              dir_name: "%kernel.root_dir%/../public/uploads"
              base_url: 'http://example.com/uploads'
```

> For performance reasons public files are served directly thought the http server, then the `base_url` must be a valid public accessible folder where the files are located.

Create a new entity `File`

```
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Ynlo\GraphQLBundle\Annotation as GraphQL;
use Ynlo\GraphQLMediaService\Model\AbstractFile;

/**
 * @ORM\Entity()
 * @ORM\Table()
 *
 * @GraphQL\ObjectType()
 */
class File extends AbstractFile
{

}
```

At this point you must have a mutation called `uploadFile` in your graphql schema, see [graphql-multipart-request-spec](https://github.com/jaydenseric/graphql-multipart-request-spec)for details of using multipart form data to upload files.

### Assign uploaded files to existent object

[](#assign-uploaded-files-to-existent-object)

Upload files to the server is only the first step, you must able to link that files to existent objects. For example link a uploaded photo to the user profile.

Create a field to store the relation on a existent entity:

```
/**
 * @ORM\Entity()
 * @ORM\Table()
 *
 * @GraphQL\ObjectType()
 */
class Profile implements NodeInterface
{
//....
/**
 * @var File
 *
 * @ORM\OneToOne(targetEntity="AppBundle\Entity\File", orphanRemoval=true)
 *
 * @GraphQL\Expose()
 *
 * @MediaService\AttachFile()
 */
protected $photo;
```

> Note the annotation `@MediaService\AttachFile()` is required on properties linked to Files in order to resolve some parameters like the `url` in runtime.

@TODO ...

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~230 days

Total

4

Last Release

1989d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a2b6fe4cdd0f7970b78769f972884c46759925b8bfe9814e47a2799b6439de7?d=identicon)[rafrsr](/maintainers/rafrsr)

---

Top Contributors

[![rafrsr](https://avatars.githubusercontent.com/u/7094012?v=4)](https://github.com/rafrsr "rafrsr (47 commits)")[![yceruto](https://avatars.githubusercontent.com/u/2028198?v=4)](https://github.com/yceruto "yceruto (4 commits)")

---

Tags

graphqlmedia-service

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ynloultratech-graphql-media-service/health.svg)

```
[![Health](https://phpackages.com/badges/ynloultratech-graphql-media-service/health.svg)](https://phpackages.com/packages/ynloultratech-graphql-media-service)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M719](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M379](/packages/easycorp-easyadmin-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[oro/platform

Business Application Platform (BAP)

642140.7k110](/packages/oro-platform)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M482](/packages/pimcore-pimcore)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9417.2k59](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
