wp-graphql / wp-graphql-tax-query

Adds `tax_query` support to postObject connection queries using WP_Query
46 stars 16 forks source link

Version 0.1.0 is crashing nuxt #18

Closed dChiamp closed 4 years ago

dChiamp commented 4 years ago

Expected Behavior

Should enable taxQuery on RootQueryToPageConnectionWhereArgs

Current Behavior

Crashes nuxt app on install. Receiving error Fatal error: Uncaught ArgumentCountError: Too few arguments to function WPGraphQL\TaxQuery::add_input_fields(), 3 passed in /www/wp-includes/class-wp-hook.php on line 286 and exactly 4 expected in /www/wp-content/plugins/wp-graphql-tax-query-master/wp-graphql-tax-query.php:131 Stack trace: #0 /www/wp-includes/class-wp-hook.php(286): WPGraphQL\TaxQuery->add_input_fields(Array, 'RootQueryToCate...', Array) #1 /www/wp-includes/plugin.php(208): WP_Hook->apply_filters(Array, Array) #2 /www/wp-content/plugins/wp-graphql-develop/src/Type/WPInputObjectType.php(40): apply_filters('graphql_input_f...', Array, 'RootQueryToCate...', Array) #3 /www/wp-content/plugins/wp-graphql-develop/src/Registry/TypeRegistry.php(440): WPGraphQL\Type\WPInputObjectType::prepare_fields(Array, 'RootQueryToCate...') #4 [internal function]: WPGraphQL\Registry\TypeRegistry->WPGraphQL\Registry\{closure}() #5 /www/wp-content/plugins/wp-graphql-develop/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectType.php(50): call_user_func(Object(Closure)) #6 in /www/wp-content/plugins/wp-graphql-tax-query-master/wp-graphql-tax-query.php on line 131 from wordpress-backend.com/graphql

Steps to Reproduce

  1. Install WP GraphQl Version 0.4.1
  2. Install WPGraphQL Tax Query Version 0.3.1
jasonbahl commented 4 years ago

@dChiamp thanks for reporting. This does look like a bug with WPGraphQL not passing $typeRegistry properly into the graphql_input_fields filter.

Fix on its way.

jasonbahl commented 4 years ago

Closing this issue and moving it here: https://github.com/wp-graphql/wp-graphql/issues/1037

The issue is with a filter not properly passing from WPGraphQL