{"id":20111917,"url":"https://github.com/graphpql/graphpinator-upload","last_synced_at":"2025-08-21T18:10:24.147Z","repository":{"id":36977228,"uuid":"372611823","full_name":"graphpql/graphpinator-upload","owner":"graphpql","description":":zap::globe_with_meridians::zap: Module to handle multipart formdata requests.","archived":false,"fork":false,"pushed_at":"2024-11-01T11:29:35.000Z","size":409,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-01T12:25:11.027Z","etag":null,"topics":["graphql","graphql-php","php"],"latest_commit_sha":null,"homepage":"https://github.com/graphpql","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphpql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-31T19:39:42.000Z","updated_at":"2024-11-01T11:29:32.000Z","dependencies_parsed_at":"2024-01-01T23:26:49.787Z","dependency_job_id":"fe895711-4fff-4750-a282-40055ed4a3fb","html_url":"https://github.com/graphpql/graphpinator-upload","commit_stats":null,"previous_names":["graphpql/graphpinator-upload","infinityloop-dev/graphpinator-upload"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphpql%2Fgraphpinator-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphpql","download_url":"https://codeload.github.com/graphpql/graphpinator-upload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224499987,"owners_count":17321614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","graphql-php","php"],"created_at":"2024-11-13T18:18:11.068Z","updated_at":"2024-11-13T18:18:11.632Z","avatar_url":"https://github.com/graphpql.png","language":"PHP","readme":"# GraPHPinator Upload [![PHP](https://github.com/graphpql/graphpinator-upload/actions/workflows/php.yml/badge.svg)](https://github.com/graphpql/graphpinator-upload/actions/workflows/php.yml) [![codecov](https://codecov.io/gh/infinityloop-dev/graphpinator-upload/branch/master/graph/badge.svg)](https://codecov.io/gh/infinityloop-dev/graphpinator-upload)\n\n:zap::globe_with_meridians::zap: Module to handle multipart formdata requests.\n\n## Introduction\n\nThis Module allows GraPHPinator to handle uploads using [multipart-formdata](https://github.com/jaydenseric/graphql-multipart-request-spec) requests.\nThis module hooks into Graphpinator workflow before parsing the request, reads the map and places uploaded files into according variable.\n\n## Installation\n\nInstall package using composer\n\n```composer require infinityloop-dev/graphpinator-upload```\n\n## How to use\n\n1. Implement `FileProvider`\n\n`FileProvider` is a service that extracts files from a multipart request by their key. Each HTTP framework provides its own implementation and `FileProvider` serves as an adapter. Framework specific implementations can be found in Graphpinator packages for according framework, eg `infinityloop-dev/graphpinator-nette` contains `FileProvider` implementation for Nette's HTTP abstraction.\n\n2. Register `UploadModule` as GraPHPinator module:\n\n```php\n$uploadModule = new \\Graphpinator\\Upload\\UploadModule($fileProvider);\n$graphpinator = new \\Graphpinator\\Graphpinator(\n    $schema,\n    $catchExceptions,\n    new \\Graphpinator\\Module\\ModuleSet([$uploadModule, /* possibly other modules */]),\n    $logger,\n);\n```\n\n3. Register `UploadType` to your `Container`:\n\n\u003e This step is probably done by registering `UploadType` as service to your DI solution.\n\n4. Optional step: Use `infinityloop-dev/graphpinator-constraint-directives` to validate uploaded files.\n\n\u003e For more information visit [constraint directives package](https://github.com/infinityloop-dev/graphpinator-constraint-directives).\n\n## Known limitations\n\n- Currently, this Module can place files only to variable values and not to arguments directly.\n    - This is done to ensure implementation simplicity \u0026 compatibility with other modules.\n    - There is probably no benefit in placing the files directly to arguments. If you stumble upon some important edge scenario, please open an issue and we can discuss possible solution here.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphpql%2Fgraphpinator-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphpql%2Fgraphpinator-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphpql%2Fgraphpinator-upload/lists"}