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

- changes commentTypeNotIn field to a listOf String instead of String #2325

Open
wants to merge 12 commits into
base: v2.0/develop
Choose a base branch
from

Conversation

jasonbahl
Copy link
Collaborator

@jasonbahl jasonbahl commented Apr 4, 2022

What does this implement/fix? Explain your changes.

This changes the commentTypeNotIn field on Comment connections to be a list_of => string type instead of a string type.

Does this close any currently open issues?

closes #2321

Any other comments?

This is a breaking change, as queries that were written like so:

query getComments( $notIn: String ) {
  comments( where: { commentTypeNotIn: $notIn ) {
    ...
  }
}

would need to be changed like so:

query getComments( $notIn: [String] ) { # <-- note the change to the variable declaration
  comments( where: { commentTypeNotIn: $notIn ) {
    ...
  }
}

Breaking Change

This includes a minor breaking change to the Schema, as seen here: https://github.com/wp-graphql/wp-graphql/runs/5823051931?check_suite_focus=true

Should you need to keep backward compatibility with the previous shape of the commentTypeNotIn field, this snippet will change the field back to a string instead of a listOf( string )

add_filter( 'graphql_input_fields', function( $fields, $type_name, $config, $type_registry ) {

	if ( ! array_key_exists( 'commentTypeNotIn', $fields ) ) {
		return $fields;
	}

	$fields['commentTypeNotIn']['type'] = 'String';

	return $fields;

}, 10, 4 );

@jasonbahl jasonbahl added the Compat: Breaking Change This is a breaking change to existing functionality label Apr 4, 2022
@jasonbahl jasonbahl self-assigned this Apr 4, 2022
@stale
Copy link

stale bot commented Aug 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 2, 2022
@stale
Copy link

stale bot commented Sep 1, 2022

This issue has been automatically closed because it has not had recent activity. If you believe this issue is still valid, please open a new issue and mark this as a related issue.

@stale stale bot closed this Sep 1, 2022
@justlevine justlevine reopened this Sep 2, 2022
@stale stale bot removed the stale label Sep 2, 2022
@stale
Copy link

stale bot commented Dec 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale? May need to be revalidated due to prolonged inactivity label Dec 1, 2022
@stale
Copy link

stale bot commented Mar 1, 2023

This issue has been automatically closed because it has not had recent activity. If you believe this issue is still valid, please open a new issue and mark this as a related issue.

@stale stale bot closed this Mar 1, 2023
@justlevine justlevine reopened this Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat: Breaking Change This is a breaking change to existing functionality Stale? May need to be revalidated due to prolonged inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants