Skip to content

Commit d4d366d

Browse files
authored
Merge pull request #2271 from wp-graphql/release/v1.7.1
Release/v1.7.1
2 parents 4ddfbb9 + 176b9a2 commit d4d366d

7 files changed

Lines changed: 41 additions & 8 deletions

File tree

.github/workflows/upload-schema-artifact.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Schema Linter
1+
name: Upload Schema Artifact
22

33
on:
44
release:
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup PHP w/ Composer & WP-CLI
2525
uses: shivammathur/setup-php@v2
2626
with:
27-
php-version: 7.3
27+
php-version: 7.4
2828
extensions: mbstring, intl, bcmath, exif, gd, mysqli, opcache, zip, pdo_mysql
2929
coverage: none
3030
tools: composer, wp-cli

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 1.7.1
4+
5+
## Chores / Bugfixes
6+
7+
- ([#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.
8+
9+
310
## 1.7.0
411

512
## Chores / Bugfixes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wp-graphql",
3-
"version": "1.7.0",
3+
"version": "1.7.1",
44
"description": "GraphQL API for WordPress",
55
"homepage": "https://github.com/wp-graphql/wp-graphql#readme",
66
"author": "WPGraphQL <info@wpgraphql.com> (https://www.wpgraphql.com)",

packages/wpgraphiql/components/App/App.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@ const FilteredApp = () => {
2121
return hooks.applyFilters("graphiql_app", <Router />, { appContext });
2222
};
2323

24+
25+
/**
26+
* QueryParamHistory object, used to define how
27+
* the UseQueryParams hook should modify browser history
28+
*/
29+
const queryParamHistory = {
30+
push: args => {
31+
// we replace the state to not
32+
// constantly add to the history for every
33+
// character change
34+
history.replaceState(null, null, args.href);
35+
},
36+
replace: args => {
37+
history.replaceState(null, null, args.href);
38+
}
39+
}
40+
2441
/**
2542
* Return the app
2643
*
@@ -48,8 +65,10 @@ export const AppWithContext = () => {
4865
}
4966
}, []);
5067

68+
69+
5170
return render ? (
52-
<QueryParamProvider>
71+
<QueryParamProvider history={queryParamHistory}>
5372
<QueryParams config={filteredQueryParamsConfig}>
5473
{(renderProps) => {
5574
const { query, setQuery } = renderProps;

readme.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: GraphQL, API, Gatsby, Headless, Decoupled, React, Nextjs, Vue, Apollo, RES
44
Requires at least: 5.0
55
Tested up to: 5.9.1
66
Requires PHP: 7.1
7-
Stable tag: 1.7.0
7+
Stable tag: 1.7.1
88
License: GPL-3
99
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1010

@@ -131,6 +131,13 @@ Composer dependencies are no longer versioned in Github. Recommended install sou
131131

132132
== Changelog ==
133133

134+
= 1.7.1 =
135+
136+
**Chores / Bugfixes**
137+
138+
- ([#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.
139+
140+
134141
= 1.7.0 =
135142

136143
**Chores / Bugfixes**

src/WPGraphQL.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private function setup_constants() {
130130

131131
// Plugin version.
132132
if ( ! defined( 'WPGRAPHQL_VERSION' ) ) {
133-
define( 'WPGRAPHQL_VERSION', '1.7.0' );
133+
define( 'WPGRAPHQL_VERSION', '1.7.1' );
134134
}
135135

136136
// Plugin Folder Path.

wp-graphql.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Description: GraphQL API for WordPress
77
* Author: WPGraphQL
88
* Author URI: http://www.wpgraphql.com
9-
* Version: 1.7.0
9+
* Version: 1.7.1
1010
* Text Domain: wp-graphql
1111
* Domain Path: /languages/
1212
* Requires at least: 5.0
@@ -18,7 +18,7 @@
1818
* @package WPGraphQL
1919
* @category Core
2020
* @author WPGraphQL
21-
* @version 1.7.0
21+
* @version 1.7.1
2222
*/
2323

2424
// Exit if accessed directly.

0 commit comments

Comments
 (0)