Skip to content

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

Open
jasonbahl wants to merge 12 commits intowp-graphql:v2.0/developfrom
jasonbahl:v2.0/fix/commentTypeNotIn-change-to-listOf
Open

- changes commentTypeNotIn field to a listOf String instead of String#2325
jasonbahl wants to merge 12 commits intowp-graphql:v2.0/developfrom
jasonbahl:v2.0/fix/commentTypeNotIn-change-to-listOf

Conversation

@jasonbahl
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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.

2 participants