Closed
Description
We're trying to tweak graphql-compose-connection
to add data to the edges.
Concretely, we have an m-to-n relationship in mongo linking to collections X
and Y
using a collection XY
which has data itself:
XY = new mongoose.Schema({
xId: ObjectId,
yId: ObjectId,
kind: String,
})
Ideally, I'd like to have the following schema:
xs {
<x fields>
ys {
edges {
kind // <- comes from `XY`
node {
<y fields>
}
}
}
}
How could graphql-compose-connection
support this?
Some things aren't clear, like how to do filtering, how to deal with indexes.
Our current idea for filtering would allow for something like:
ys(filter: { node: {<y fields>}, edge: { kind: "kind1" } }) {
where I can do filtering both on the edge and the node.
What do you think? We have a WIP