All Projects β†’ dre1080 β†’ wp-graphql-upload

dre1080 / wp-graphql-upload

Licence: GPL-3.0 license
Upload support and functionality for WPGraphQL as specified by graphql-multipart-request-spec.

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to wp-graphql-upload

wp-graphql-gravity-forms
GraphQL API for interacting with Gravity Forms.
Stars: ✭ 119 (+357.69%)
Mutual labels:  wp-plugin, wpgraphql, wpgraphql-plugin
Wp Graphql
πŸš€ GraphQL API for WordPress
Stars: ✭ 3,097 (+11811.54%)
Mutual labels:  wp-plugin, wpgraphql
httpfs
Go ηΌ–ε†™ηš„ι™ζ€ζ–‡δ»ΆζœεŠ‘ε™¨οΌŒζ”―ζŒζ–‡δ»Άζ‹–ζ‹½δΈŠδΌ οΌŒζ— η¬¬δΈ‰ζ–ΉεŒ…δΎθ΅–, ζ”―ζŒ Windows, Linux , Darwin。
Stars: ✭ 28 (+7.69%)
Mutual labels:  upload
PHP-FileUpload
Simple and convenient file uploads β€” secure by default
Stars: ✭ 53 (+103.85%)
Mutual labels:  upload
uploadex
Elixir library for handling uploads with Ecto, Phoenix and Absinthe
Stars: ✭ 23 (-11.54%)
Mutual labels:  upload
react-simple-file-input
Simple wrapper for the HTML input tag and HTML5 FileReader API
Stars: ✭ 29 (+11.54%)
Mutual labels:  upload
direct-upload-s3-signaturev4
Example of Directly uploading files to S3 with PHP
Stars: ✭ 50 (+92.31%)
Mutual labels:  upload
acf-image-aspect-ratio-crop
Image Aspect Ratio Crop field for Advanced Custom Fields
Stars: ✭ 100 (+284.62%)
Mutual labels:  wp-plugin
hanami-shrine
Upload solution for Hanami using Shrine library
Stars: ✭ 28 (+7.69%)
Mutual labels:  upload
react-native-tus-client
React Native client for the tus resumable upload protocol.
Stars: ✭ 38 (+46.15%)
Mutual labels:  upload
blobUpload
Uses file slice to upload large files. Newer version https://github.com/apivideo/uploadavideoApps. From api.video (https://api.video)
Stars: ✭ 19 (-26.92%)
Mutual labels:  upload
ionic4-image-crop-upload
Ionic 4, Angular 7 and Cordova Crop and Upload Image
Stars: ✭ 16 (-38.46%)
Mutual labels:  upload
acf-overview
ACF Overview allows to quick view configuration of all field groups
Stars: ✭ 19 (-26.92%)
Mutual labels:  wp-plugin
wpgraphql.com
The main website for WPGraphQL.com. This is a NextJS site pulling data from WordPress + WPGraphQL.
Stars: ✭ 33 (+26.92%)
Mutual labels:  wpgraphql
svelte-filepond
πŸ”Œ A handy FilePond adapter component for Svelte
Stars: ✭ 188 (+623.08%)
Mutual labels:  upload
windows-azure-storage
Use the Microsoft Azure Storage service to host your website's media files.
Stars: ✭ 48 (+84.62%)
Mutual labels:  upload
acf-dropzone
Drop file uploads directly on ACF file fields
Stars: ✭ 31 (+19.23%)
Mutual labels:  upload
EspBuddy
Wrapper to easily upload (OTA or Serial), backup, batch query, monitor ESP8266 boards using Esptool.py, Espota.py and Platformio
Stars: ✭ 47 (+80.77%)
Mutual labels:  upload
view-admin-as
View the WordPress admin as a different role, switch between users, temporarily change your capabilities, set default screen settings for roles, manage your roles and capabilities.
Stars: ✭ 44 (+69.23%)
Mutual labels:  wp-plugin
apkup
πŸš€ Publish APKs to Google Play directly from the terminal
Stars: ✭ 33 (+26.92%)
Mutual labels:  upload

WPGraphQL Upload

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

Requirements

Using this plugin requires having the WPGraphQL plugin installed and activated.

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].