Skip to content

Commit

Permalink
Feature/fix connection args (#19)
Browse files Browse the repository at this point in the history
* fix old connection resolver

* increment version
  • Loading branch information
hsimah authored May 26, 2020
1 parent 282162b commit 8541a3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions class-facetwp.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ private function register_facet_connection($config)
'toType' => $singular,
'fromFieldName' => lcfirst($plural),
'connectionArgs' => PostObjects::get_connection_args(),
'resolveNode' => function ($id, $_args, $context, $_info) {
return !empty($id) ? DataSource::resolve_post_object($id, $context) : null;
'resolveNode' => function ($node, $_args, $context, $_info) {
return !empty($node) ? DataSource::resolve_post_object($node->ID, $context) : null;
},
'resolve' => function ($source, $args, $context, $info) use ($type) {
$resolver = new PostObjectConnectionResolver($source, $args, $context, $info, $type);
$resolver = new PostObjectConnectionResolver($source, $args, $context, $info, $type);
$resolver->setQueryArg('post__in', $source['results']);

return $resolver->get_connection();
Expand Down
4 changes: 2 additions & 2 deletions wp-graphql-facetwp.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* Description: WP GraphQL provider for FacetWP
* Author: hsimah
* Author URI: http://www.hsimah.com
* Version: 0.1.0
* Version: 0.1.1
* Text Domain: wpgraphql-facetwp
* License: GPL-3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*
* @package WPGraphQL_FacetWP
* @author hsimah
* @version 0.1.0
* @version 0.1.1
*/

// Exit if accessed directly.
Expand Down

0 comments on commit 8541a3e

Please sign in to comment.