Skip to content

feat: allow global/database IDs in Term connection where args ID inputs #2524

Merged
jasonbahl merged 8 commits intowp-graphql:developfrom
justlevine:feat/allow-global-db-ids-in-term-where-args
Sep 19, 2022
Merged

feat: allow global/database IDs in Term connection where args ID inputs #2524
jasonbahl merged 8 commits intowp-graphql:developfrom
justlevine:feat/allow-global-db-ids-in-term-where-args

Conversation

@justlevine
Copy link
Copy Markdown
Collaborator

@justlevine justlevine commented Sep 18, 2022

What does this implement/fix? Explain your changes.

This PR allows Term connection where args with a type ID to accept either global IDs or database IDs.

It also deprecates the termTaxonomId where arg, in favor of the correctly-spelled termTaxonomyId.

This PR replaces #2340 , and requires #2521 to be merged as a prerequisite.

Does this close any currently open issues?

Part of #998

Any relevant logs, error output, GraphiQL screenshots, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Any other comments?

Did not backfill tests for cacheDomain, padCounts, and updateTermMetaCache. I'm not entirely sure the effects of these nor how to test if the where arg has any effect on the query results.
No code has changed regarding the handling of those args, so they're not technically required for this PR to merge.

Where has this been tested?

Operating System: Ubuntu 20.04 (wsl2 + devilbox + PHP 8.0.19)

WordPress Version: 6.0.2

*
* @return array
*/
public function get_args() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_args has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.

@justlevine justlevine added type: enhancement Improvements to existing functionality status: in review Awaiting review before merging or closing component: connections Relating to GraphQL Connections object type: term Relating to the Term Types labels Sep 18, 2022
@justlevine justlevine changed the title feat: allow global/database IDs in term connection where args ID inputs feat: allow global/database IDs in Term connection where args ID inputs Sep 18, 2022
@coveralls
Copy link
Copy Markdown

coveralls commented Sep 18, 2022

Coverage Status

Coverage decreased (-0.02%) to 81.788% when pulling d3a7a15 on justlevine:feat/allow-global-db-ids-in-term-where-args into a2098ea on wp-graphql:develop.

@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit d3a7a15 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

@jasonbahl jasonbahl merged commit c0553ef into wp-graphql:develop Sep 19, 2022
@justlevine justlevine deleted the feat/allow-global-db-ids-in-term-where-args branch September 19, 2022 16:52
@jasonbahl jasonbahl mentioned this pull request Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: connections Relating to GraphQL Connections object type: term Relating to the Term Types status: in review Awaiting review before merging or closing type: enhancement Improvements to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants