Support for Relationship Meta
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- graphql, php
- Domain
- backend-api-design, database
Research direction
No source files, entry points, or tests are named. Start by mapping the repository’s relationship storage and query paths, then review how GraphQL edges are exposed. Done means relationship-scoped metadata can be stored and, where appropriate, queried and exposed on the corresponding edges.
Written by the indexing model from the issue text.
Description
It would be awesome to have support for relationship meta.
There’s often situations where data isn’t a property of one entity or the other, but exists only in the context of their relationship with each other, and it doesn’t make sense to store said data in the meta of one or the other object, but ideally somewhere between, such as relationship meta.
For example, let’s say we were making an activity stream, and we wanted “activity items” to show as “unread” or “read” (similar to email). Since activity items and users would be a many-to-many relationship, we wouldn’t want an activity to be marked “read” when any user read it, we’d only want it to be marked “read” for you, if you read it.
Currently, the options are to store an array of user IDs in the activity item meta, and use that to determine if the current user has or has not “read” the item, or you could store an array of items in each users meta. . . Neither are good solutions. Storing user IDs on the activity is likely the better of the two, but still doesn’t scale
If you have a lot of users.
It would be awesome to have a formal way to store this contextual data, and in some cases even query by it.
I believe Posts 2 Posts has support for relationship meta. Might be worth looking at for inspiration 🤷♂️🤔
Anyway, I can think of heaps of examples where this would be useful.
—
Gotta throw out mention of GraphQL while I’m at it... 😀
In the WPGraphQL Schema, there’s a concept of “edges” which is the space between two nodes. For example, there’s an edge between a user and a post, or a Post and a Featured Image. This “edge” space is used for exposing contextual information that’s only relevant in the context of the relationship between the two connected nodes.
WPGraphQL could easily take advantage of relationship meta by exposing it on the edges.
- Dominant language
- PHP
- Stars
- 97
- Forks
- 24
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 10up/wp-content-connect
-
help wanted wpvc
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
10up/wp-content-connect#161 ·
-
Release version 2.0.0Possibly taken @jeffpaul claimed this 2 days ago. Opentype:question
10up/wp-content-connect#162 · 1 assignee ·
-
Add support for displaying the UI when multiple "to" post types are defiend.Possibly taken @gthayer claimed this 551 days ago. Open
10up/wp-content-connect#103 · 1 comment · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
10up/wp-content-connect#65 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
10up/wp-content-connect#36 · 1 comment ·
All issues in 10up/wp-content-connect
Similar issues
-
wpvc
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
10up/autoshare-for-twitter#438 ·
-
wpvc
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
10up/Ad-Refresh-Control#240 ·
-
wpvc
Difficulty 1/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Backend bug severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
RunningJoke/allipunkte#74 ·