Download the PHP package ynloultratech/graphql-media-service without Composer
On this page you can find all versions of the php package ynloultratech/graphql-media-service. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ynloultratech/graphql-media-service
More information about ynloultratech/graphql-media-service
Files in ynloultratech/graphql-media-service
Package graphql-media-service
Short Description Serve and manage files using a graphql API
License MIT
Informations about the package 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.
- [X] Single endpoint to upload your files trough a API.
- [X] GraphQL Object for files to get details and download url.
- [X] Public and Private files using signed urls
- [X] Direct relations between files and entities
Installation
Install using composer:
composer require graphql-media-service
How its works?
Usage
The following steps assume you have a configured GraphQLAPI using graphql-bundle.
Add the following config in your config.yml
`
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
``
At this point you must have a mutation called uploadFile
in your graphql schema,
see graphql-multipart-request-spec
for details of using multipart form data to upload files.
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:
``
Note the annotation
@MediaService\AttachFile()
is required on properties linked to Files in order to resolve some parameters like theurl
in runtime.
@TODO ...
All versions of graphql-media-service with dependencies
symfony/form Version ^3.4
symfony/framework-bundle Version ^3.4
doctrine/annotations Version ^1.5
doctrine/common Version ^2.8
myclabs/deep-copy Version ^1.7
mindplay/readable Version ^1.1
mtdowling/jmespath.php Version ^2.4
ynloultratech/graphql-bundle Version ^1.4
spatie/url-signer Version ^1.0