承接 dre1080/wp-graphql-upload 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dre1080/wp-graphql-upload

最新稳定版本:v0.1.5

Composer 安装命令:

composer require dre1080/wp-graphql-upload

包简介

Adds file upload support to the WP GraphQL Plugin.

README 文档

README

This plugin adds Upload support to the WPGraphQL plugin as specified by graphql-multipart-request-spec.

Requirements

  • PHP >= 7.1
  • WordPress >= 5.0
  • WPGraphQL >= 1.0.0

Activating / Using

You can install and activate the plugin like any WordPress plugin. Download the .zip from Github and add to your plugins directory, then activate.

Once the plugin is active, the Upload scalar type will be available to your mutation input fields.

If you're using composer:

composer require dre1080/wp-graphql-upload

Usage

Then you can start using in your mutations like so:

register_graphql_mutation( 'upload', [ 'inputFields' => [ 'file' => [ 'type' => ['non_null' => 'Upload'], ], ], 'outputFields' => [ 'text' => [ 'type' => 'String', 'resolve' => function ($payload) { return $payload['text']; }, ], ], 'mutateAndGetPayload' => function ($input) { if (!function_exists('wp_handle_sideload')) { require_once(ABSPATH . 'wp-admin/includes/file.php'); } wp_handle_sideload($input['file'], [ 'test_form' => false, 'test_type' => false, ]); return [ 'text' => 'Uploaded file was "' . $input['file']['name'] . '" (' . $input['file']['type'] . ').', ]; } ] );

Testing

Requirements:

To run the tests, run the following commands:

bin/install-wp-tests.sh vendor/bin/phpunit

统计信息

  • 总下载量: 48.06k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 38
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 38
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固