You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: