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

Register comments connection on NodeWithComments #2290

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

chriszarate
Copy link
Collaborator

What does this implement/fix? Explain your changes.

Register comments connection on NodeWithComments interface instead of one individual post types.

Does this close any currently open issues?

n/a

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

n/a

Any other comments?

I like interfaces. :)

Where has this been tested?

*Operating System: macOS

WordPress Version: 5.9

@codeclimate
Copy link

codeclimate bot commented Mar 10, 2022

Code Climate has analyzed commit fa5cb24 and detected 0 issues on this pull request.

View more on Code Climate.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.005%) to 79.256% when pulling fa5cb24 on chriszarate:fix/comments-registration-on-interface into 70dc88b on wp-graphql:develop.

@jasonbahl
Copy link
Collaborator

@chriszarate thanks for the PR!

I ultimately want to get here!

What I think needs to happen, still, is that Connections from/to Interfaces need to be able to also register edge Types for the specific relationships.

For example, if we were to have a generic ContentNode -> Term connection, then the following Types should also be generated in the Schema:

Types for the generic connection

  • ContentNodeToTermConnection
  • ContentNodeToTermConnectionEdge

Specific Types for the specific connections

  • PostToTagConnection implements ContentNodeToTermConnection
  • PostToTermConnectionEdge implements ContentNodeToTermConnectionEdge
  • PostToCategoryConnection implements ContentNodeToTermConnection
  • PostToCategoryConnectionEdge implements ContentNodeToTermConnectionEdge

This allows for Specific relationships to have specific edge data exposed in the Schema.

For example, if we had some relational data only between Pages and Comments but not other post types, with the current PR we would have to expose the edge data to all ContentNode -> Comments connections, which would be inaccurate.

I believe #1738 starts laying some of this ground work, but there's definitely more work to do in the Connections realm to get to this final destination.

Happy to chat more about it and see what we can do to get there.

Would be 🔥 to have the register_graphql_connection API do most of this work with little-to-no change to the registration of connections.

@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
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

4 participants