Skip to content

Commit

Permalink
Merge pull request #2279 from wp-graphql/release/v1.7.2
Browse files Browse the repository at this point in the history
Release/v1.7.2
  • Loading branch information
jasonbahl committed Mar 8, 2022
2 parents d4d366d + 8fcb6db commit a8b7361
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 58 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@
/phpstan.neon.dist export-ignore
/schema.graphql export-ignore
/node_modules export-ignore
/packages export-ignore
/artifacts export-ignore
7 changes: 1 addition & 6 deletions .github/workflows/deploy-to-wordpress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ jobs:
- name: Install PHP dependencies
run: |
composer install --no-dev --optimize-autoloader
- name: Install NPM Dependencies
run: |
npm install
- name: Build JavaScript App (GraphiQL)
run: |
npm run build
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/graphiql-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ jobs:
- name: Install Composer Dependencies
run: |
composer install --no-dev
- name: Npm install and build
run: |
npm ci && npm run build
- name: Install WordPress
run: |
npm run wp-env start
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/graphiql-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ jobs:
run: |
composer install --no-dev
- name: Npm install and build
run: |
npm install && npm run build
- name: Install WordPress
run: |
npm run wp-env start
Expand Down
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# Changelog

## 1.7.2

### Chores / Bugfixes

- ([#2276](https://github.com/wp-graphql/wp-graphql/pull/2276)): Fixes a bug where `generalSettings.url` field was not in the Schema for multisite installs.
- ([#2278](https://github.com/wp-graphql/wp-graphql/pull/2278)): Adds a composer post-install script that installs JS dependencies and builds the JS app when `composer install` is run
- ([#2277](https://github.com/wp-graphql/wp-graphql/pull/2277)): Adds a condition to the docker image to only run `npm` scripts if the project has a package.json. Thanks @markkelnar!

## 1.7.1

## Chores / Bugfixes
### Chores / Bugfixes

- ([#2268](https://github.com/wp-graphql/wp-graphql/pull/2268)): Fixes a bug in GraphiQL that would update browser history with every change to a query param.


## 1.7.0

## Chores / Bugfixes
### Chores / Bugfixes

- ([#2228](https://github.com/wp-graphql/wp-graphql/pull/2228)): Allows optional fields to be set to empty values in the `updateUser` mutation. Thanks @victormattosvm!
- ([#2247](https://github.com/wp-graphql/wp-graphql/pull/2247)): Add WordPress 5.9 to the automated testing matrix. Thanks @markkelnar!
Expand All @@ -18,7 +26,7 @@
- ([#2263](https://github.com/wp-graphql/wp-graphql/pull/2263)): Adds documentation entry for WordPress Application Passwords guide. Thanks @abhisekmazumdar!
- ([#2262](https://github.com/wp-graphql/wp-graphql/pull/2262)): Fixes a bug where settings registered via the core `register_setting()` API would cause Schema Introspection failures, causing GraphiQL and other tools to not work properly.

## New Features
### New Features

- ([#2248](https://github.com/wp-graphql/wp-graphql/pull/2248)): WPGraphiQL (the GraphiQL IDE in the WordPress dashboard) has been re-built to have an extension architecture and some updated user interfaces. Thanks for contributing to this effort @scottyzen!
- ([#2246](https://github.com/wp-graphql/wp-graphql/pull/2246)): Adds support for querying the `avatar` for the CommentAuthor Type and the Commenter Interface type.
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
"fix-cs": [
"php ./vendor/bin/phpcbf"
],
"phpstan": ["phpstan analyze --ansi --memory-limit=1G"]
"phpstan": ["phpstan analyze --ansi --memory-limit=1G"],
"post-install-cmd": [
"npm ci && npm run build"
]
},
"archive": {
"exclude": [
Expand All @@ -98,7 +101,8 @@
"!.wordpress-org/",
"docs/",
"wp-graphql.zip",
"!build"
"!build",
"packages"
]
}
}
2 changes: 2 additions & 0 deletions docker/app.post-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ if $( wp maintenance-mode is-active --allow-root ); then
echo "Deactivating maintenance mode"
wp maintenance-mode deactivate --allow-root
fi


10 changes: 2 additions & 8 deletions docker/testing.entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,13 @@ if [ ! -f "$PROJECT_DIR/c3.php" ]; then
curl -L 'https://raw.github.com/Codeception/c3/2.0/c3.php' > "$PROJECT_DIR/c3.php"
fi

# Install PHP dependencies

# Install the PHP dependencies
echo "Running composer update"
COMPOSER_MEMORY_LIMIT=-1 composer update
echo "Running composer install"
COMPOSER_MEMORY_LIMIT=-1 composer install --no-interaction

## Install JavaScript Dependencies
echo "Running npm install"
npm ci

## Build the JavaScript app
echo "Building the JavaScript app"
npm build

# Install pcov/clobber if PHP7.1+
if version_gt $PHP_VERSION 7.0 && [[ -n "$COVERAGE" ]] && [[ -z "$USING_XDEBUG" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wp-graphql",
"version": "1.7.1",
"version": "1.7.2",
"description": "GraphQL API for WordPress",
"homepage": "https://github.com/wp-graphql/wp-graphql#readme",
"author": "WPGraphQL <info@wpgraphql.com> (https://www.wpgraphql.com)",
Expand Down
11 changes: 10 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: GraphQL, API, Gatsby, Headless, Decoupled, React, Nextjs, Vue, Apollo, RES
Requires at least: 5.0
Tested up to: 5.9.1
Requires PHP: 7.1
Stable tag: 1.7.1
Stable tag: 1.7.2
License: GPL-3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -131,6 +131,15 @@ Composer dependencies are no longer versioned in Github. Recommended install sou

== Changelog ==

= 1.7.2 =

**Chores / Bugfixes**

- ([#2276](https://github.com/wp-graphql/wp-graphql/pull/2276)): Fixes a bug where `generalSettings.url` field was not in the Schema for multisite installs.
- ([#2278](https://github.com/wp-graphql/wp-graphql/pull/2278)): Adds a composer post-install script that installs JS dependencies and builds the JS app when `composer install` is run
- ([#2277](https://github.com/wp-graphql/wp-graphql/pull/2277)): Adds a condition to the docker image to only run `npm` scripts if the project has a package.json. Thanks @markkelnar!


= 1.7.1 =

**Chores / Bugfixes**
Expand Down
25 changes: 12 additions & 13 deletions src/Mutation/UpdateSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,24 @@ public static function get_output_fields( TypeRegistry $type_registry ) {
*/
$allowed_setting_groups = DataSource::get_allowed_settings_by_group( $type_registry );

/**
* Get all of the settings, regardless of group
*/
$output_fields['allSettings'] = [
'type' => 'Settings',
'description' => __( 'Update all settings.', 'wp-graphql' ),
'resolve' => function () {
return true;
},
];

if ( ! empty( $allowed_setting_groups ) && is_array( $allowed_setting_groups ) ) {
foreach ( $allowed_setting_groups as $group => $setting_type ) {

$setting_type = DataSource::format_group_name( $group );
$setting_type_name = Utils::format_type_name( $setting_type . 'Settings' );

$output_fields[ $setting_type_name ] = [
$output_fields[ Utils::format_field_name( $setting_type_name ) ] = [
'type' => $setting_type_name,
'description' => sprintf( __( 'Update the %s setting.', 'wp-graphql' ), $setting_type_name ),
'resolve' => function () use ( $setting_type_name ) {
Expand All @@ -135,18 +146,6 @@ public static function get_output_fields( TypeRegistry $type_registry ) {

}
}

/**
* Get all of the settings, regardless of group
*/
$output_fields['allSettings'] = [
'type' => 'Settings',
'description' => __( 'Update all settings.', 'wp-graphql' ),
'resolve' => function () {
return true;
},
];

return $output_fields;
}

Expand Down
28 changes: 14 additions & 14 deletions src/Registry/TypeRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,21 +536,21 @@ public function init_type_registry( TypeRegistry $type_registry ) {
*/
$allowed_setting_types = DataSource::get_allowed_settings_by_group( $this );

if ( ! empty( $allowed_setting_types ) && is_array( $allowed_setting_types ) ) {
/**
* The url is not a registered setting for multisite, so this is a polyfill
* to expose the URL to the Schema for multisite sites
*/
if ( is_multisite() ) {
$this->register_field( 'GeneralSettings', 'url', [
'type' => 'String',
'description' => __( 'Site URL.', 'wp-graphql' ),
'resolve' => function () {
return get_site_url();
},
] );
}

/**
* The url is not a registered setting for multisite, so this is a polyfill
* to expose the URL to the Schema for multisite sites
*/
if ( is_multisite() ) {
register_graphql_field( 'GeneralSettings', 'url', [
'type' => 'String',
'description' => __( 'Site URL.', 'wp-graphql' ),
'resolve' => function () {
return get_site_url();
},
] );
}
if ( ! empty( $allowed_setting_types ) && is_array( $allowed_setting_types ) ) {

foreach ( $allowed_setting_types as $group_name => $setting_type ) {

Expand Down
2 changes: 1 addition & 1 deletion src/WPGraphQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private function setup_constants() {

// Plugin version.
if ( ! defined( 'WPGRAPHQL_VERSION' ) ) {
define( 'WPGRAPHQL_VERSION', '1.7.1' );
define( 'WPGRAPHQL_VERSION', '1.7.2' );
}

// Plugin Folder Path.
Expand Down
4 changes: 2 additions & 2 deletions wp-graphql.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description: GraphQL API for WordPress
* Author: WPGraphQL
* Author URI: http://www.wpgraphql.com
* Version: 1.7.1
* Version: 1.7.2
* Text Domain: wp-graphql
* Domain Path: /languages/
* Requires at least: 5.0
Expand All @@ -18,7 +18,7 @@
* @package WPGraphQL
* @category Core
* @author WPGraphQL
* @version 1.7.1
* @version 1.7.2
*/

// Exit if accessed directly.
Expand Down

0 comments on commit a8b7361

Please sign in to comment.