{"id":23152979,"url":"https://github.com/t3n/graphql-upload","last_synced_at":"2025-08-17T20:33:20.490Z","repository":{"id":42451275,"uuid":"272814666","full_name":"t3n/graphql-upload","owner":"t3n","description":"Sidecar package for t3n/graphql that provides upload resolver","archived":false,"fork":false,"pushed_at":"2022-04-05T12:19:16.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-25T14:45:58.981Z","etag":null,"topics":["flowframework","flowpackage","graphql","neoscms","php"],"latest_commit_sha":null,"homepage":"","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/t3n.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-16T21:21:17.000Z","updated_at":"2022-04-05T12:17:25.000Z","dependencies_parsed_at":"2022-08-28T07:00:54.665Z","dependency_job_id":null,"html_url":"https://github.com/t3n/graphql-upload","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/t3n/graphql-upload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t3n%2Fgraphql-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t3n%2Fgraphql-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t3n%2Fgraphql-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t3n%2Fgraphql-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t3n","download_url":"https://codeload.github.com/t3n/graphql-upload/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t3n%2Fgraphql-upload/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270902611,"owners_count":24665289,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["flowframework","flowpackage","graphql","neoscms","php"],"created_at":"2024-12-17T19:20:02.715Z","updated_at":"2025-08-17T20:33:20.221Z","avatar_url":"https://github.com/t3n.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# t3n.GraphQL.Upload\n\nSidecar package for [t3n/graphql](https://github.com/t3n/graphql) that brings an `Upload` scalar and enables you to handle file uploads in your schema.\n\nSimply install the package via composer:\n```\ncomposer require t3n/graphql-upload\n```\n\n## Configuration\nThis package ships all needed parts. However, you must add the typeDefs and the Resolver to your schema like this:\n```yaml\nt3n:\n  GraphQL:\n    endpoints:\n      'your-endpoint': #use your endpoint variable here\n        schemas:\n          upload:\n            typeDefs: 'resource://t3n.GraphQL.Upload/Private/GraphQL/schema.upload.graphql'\n            resolvers:\n              Upload: 't3n\\GraphQL\\Upload\\Resolver\\Type\\UploadResolver'\n```\nThis is everything you need to do. Once configured you can use the `Upload` scalar in your app.\n\n## Usage\nTo use the `Upload` scalar you might want to add it as an arg to a mutation like this:\n\n```graphql\ntype Mutation {\n    uploadFile(file: Upload): String\n}\n```\n\nThis package will handle the upload itself and pass an `Neos\\Http\\Factories\\FlowUploadedFile` to your `MutationResolver`. Within your resolver method your could for instance import your resource:\n\n```php\nclass MutationResolver implements ResolverInterface\n{\n    /**\n     * @Flow\\Inject\n     *\n     * @var ResourceManager\n     */\n    protected $resourceManager;\n\n    public function uploadFile($_, $variables): string\n    {\n        /** @var FlowUploadedFile $file */\n        $file = $variables['file'];\n\n        $resource = $this-\u003eresourceManager-\u003eimportResource($file-\u003egetStream()-\u003edetach());\n        $resource-\u003esetFilename($file-\u003egetClientFilename());\n        $resource-\u003esetMediaType($file-\u003egetClientMediaType());\n\n        return $file-\u003egetClientFilename();\n    }\n}\n```\n\n## Some notes\n\nTo actually use file upload your frontend client must use `multipart/form-data` in your forms. This Package is tested with a react app that uses https://github.com/jaydenseric/apollo-upload-client\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft3n%2Fgraphql-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft3n%2Fgraphql-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft3n%2Fgraphql-upload/lists"}