Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecationReason doesn't work for inputs when registering mutations #2784

Open
2 of 3 tasks
alaa-alshamy opened this issue Apr 10, 2023 · 3 comments
Open
2 of 3 tasks
Labels
Component: Input Status: Blocked Issue or pull request that can't be resolved at the moment Type: Bug Something isn't working

Comments

@alaa-alshamy
Copy link

alaa-alshamy commented Apr 10, 2023

Description

when registering a mutation using register_graphql_mutation passing deprecationReason for one of the inputs, it doesn't deprecate them.

Even trying to deprecate input for already exist mutation using graphql_input_fields filter, it doesn't deprecate them.

Steps to reproduce

add_action( 'graphql_register_types', function() {

	register_graphql_mutation( 
		'testMutation',
		[
			'inputFields'  => [
				'testInput' => [
					'type' => 'Boolean',
					'description' => 'Test input.',
					'deprecationReason' => 'Deprecated Input',
				],
			]
			'outputFields'        => [],
			'mutateAndGetPayload' => function(){},
		]
	);

});

Additional context

No response

WPGraphQL Version

v1.14.0

WordPress Version

6.0.1

PHP Version

8.0.25

Additional enviornment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
@justlevine justlevine added Type: Bug Something isn't working Component: Input labels Apr 11, 2023
@justlevine
Copy link
Collaborator

It seems that while deprecating input types is supported by graphql-spec, its not yet supported by graphql-php (tracking: webonyx/graphql-php#110).

Gonna mark this as blocked, unless someone else sees a way forward.

@justlevine justlevine added the Status: Blocked Issue or pull request that can't be resolved at the moment label Apr 11, 2023
@alaa-alshamy
Copy link
Author

any news here @justlevine, the mentioned issue already fixed

@justlevine
Copy link
Collaborator

@alaa-alshamy the upgrade from graphql-php 14.x => 15.x is a major breaking change that will likely only occur in WPGraphQL v2.0, but whenever that ships this fix will be included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Input Status: Blocked Issue or pull request that can't be resolved at the moment Type: Bug Something isn't working
Projects
Status: 🛑 On Hold
Development

No branches or pull requests

2 participants