Skip to content

feat: allow global/database IDs in Post connection where args ID inputs#2525

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

feat: allow global/database IDs in Post connection where args ID inputs#2525
jasonbahl merged 9 commits intowp-graphql:developfrom
justlevine:feat/allow-global-db-ids-in-post-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.

Additionally, the descriptions of tagSlugAnd and tagSlugIn have been updated to better convey what they actually do.

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?

  • Some existing tests were shuffled around to different classes. Queries for multiple posts are in PostObjectConnectionQueriesTests and for a singular post in PostObjectQueriesTest.
  • I didn't backfill tests for dateQuery or mimeType - because I was running out of time and didnt want to :-P . They're not essential to this PR (and no code changes to those inputs have been made), and imo we shouldnt hold up merging this and closing Update Resolvers for all ID inputs to behave consistently #998 until I have a break from client work.

Where has this been tested?

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

WordPress Version: 6.0.2

@justlevine justlevine added type: enhancement Improvements to existing functionality component: connections Relating to GraphQL Connections object type: post Relating to the Post Object Types labels Sep 18, 2022
*
* @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.

@coveralls
Copy link
Copy Markdown

coveralls commented Sep 18, 2022

Coverage Status

Coverage increased (+0.05%) to 81.852% when pulling 69dfe67 on justlevine:feat/allow-global-db-ids-in-post-where-args into a2098ea on wp-graphql:develop.

@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 69dfe67 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2

View more on Code Climate.

@justlevine justlevine marked this pull request as ready for review September 18, 2022 14:29
@justlevine justlevine added the status: in review Awaiting review before merging or closing label Sep 18, 2022
@jasonbahl jasonbahl merged commit 9423c59 into wp-graphql:develop Sep 19, 2022
@justlevine justlevine deleted the feat/allow-global-db-ids-in-post-where-args branch September 19, 2022 16:53
@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: post Relating to the Post Object 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