{"id":13610786,"url":"https://github.com/dre1080/wp-graphql-upload","last_synced_at":"2025-07-27T12:33:55.052Z","repository":{"id":41858571,"uuid":"336420576","full_name":"dre1080/wp-graphql-upload","owner":"dre1080","description":"Upload support and functionality for WPGraphQL as specified by graphql-multipart-request-spec.","archived":false,"fork":false,"pushed_at":"2024-07-08T00:36:54.000Z","size":71,"stargazers_count":36,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-20T07:46:09.685Z","etag":null,"topics":["graphql","graphql-upload","upload","wordpress","wordpress-plugin","wp-plugin","wpgraphql","wpgraphql-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dre1080.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-06T00:21:02.000Z","updated_at":"2025-02-22T18:04:22.000Z","dependencies_parsed_at":"2024-07-08T01:42:37.995Z","dependency_job_id":"cf032b98-e4ad-4b6c-8e2a-d28611a0a69a","html_url":"https://github.com/dre1080/wp-graphql-upload","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/dre1080/wp-graphql-upload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dre1080%2Fwp-graphql-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dre1080%2Fwp-graphql-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dre1080%2Fwp-graphql-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dre1080%2Fwp-graphql-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dre1080","download_url":"https://codeload.github.com/dre1080/wp-graphql-upload/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dre1080%2Fwp-graphql-upload/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267359083,"owners_count":24074675,"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-07-27T02:00:11.917Z","response_time":82,"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":["graphql","graphql-upload","upload","wordpress","wordpress-plugin","wp-plugin","wpgraphql","wpgraphql-plugin"],"created_at":"2024-08-01T19:01:47.990Z","updated_at":"2025-07-27T12:33:55.019Z","avatar_url":"https://github.com/dre1080.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# WPGraphQL Upload\n\nThis plugin adds Upload support to the [WPGraphQL plugin](https://github.com/wp-graphql/wp-graphql) as specified by [graphql-multipart-request-spec](https://github.com/jaydenseric/graphql-multipart-request-spec).\n\n## Requirements\n- PHP \u003e= 7.1\n- WordPress \u003e= 5.0\n- [WPGraphQL]((https://github.com/wp-graphql/wp-graphql)) \u003e= 1.0.0\n\n## Activating / Using\n\nYou can install and activate the plugin like any WordPress plugin. Download the .zip from Github and add to your plugins directory, then activate.\n\nOnce the plugin is active, the `Upload` scalar type will be available to your mutation input fields.\n\nIf you're using composer:\n\n```sh\ncomposer require dre1080/wp-graphql-upload\n```\n\n## Usage\n\nThen you can start using in your mutations like so:\n\n```php\nregister_graphql_mutation(\n  'upload', [\n      'inputFields' =\u003e [\n          'file' =\u003e [\n              'type' =\u003e ['non_null' =\u003e 'Upload'],\n          ],\n      ],\n      'outputFields' =\u003e [\n          'text' =\u003e [\n              'type'    =\u003e 'String',\n              'resolve' =\u003e function ($payload) {\n                  return $payload['text'];\n              },\n          ],\n      ],\n      'mutateAndGetPayload' =\u003e function ($input) {\n          if (!function_exists('wp_handle_sideload')) {\n              require_once(ABSPATH . 'wp-admin/includes/file.php');\n          }\n\n          wp_handle_sideload($input['file'], [\n              'test_form' =\u003e false,\n              'test_type' =\u003e false,\n          ]);\n\n          return [\n              'text' =\u003e 'Uploaded file was \"' . $input['file']['name'] . '\" (' . $input['file']['type'] . ').',\n          ];\n      }\n  ]\n);\n```\n\n## Testing\n\nRequirements:\n\n- [svn](https://subversion.apache.org/)\n- [wp-cli](https://wp-cli.org/)\n\nTo run the tests, run the following commands:\n\n```sh\nbin/install-wp-tests.sh\nvendor/bin/phpunit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdre1080%2Fwp-graphql-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdre1080%2Fwp-graphql-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdre1080%2Fwp-graphql-upload/lists"}