Hello!
Currently i have link connection between domains. Basically a domain graph.
In sql database i have a table with many to many relation and one more field what represents how many target links was found on source domain.
SQL domain_links table:
I want to add links field in schema and use it to sort domain by this field. But i don’t know how to correctly create many-to-many connection for graph.
Let me know if this structure solves your problem or not.
If you want to use GraphQL Layer in your app we can easily use hasInverse directive to connect domains and their connections and then query differently.
Currently DQL is more understandable for me
This schema and query works, but in other way.
I tried this query and seems what it adds extra nodes (Connections) on graph (blue points). I need a seamless join of two domains and to see only domains nodes without “Connections” (should be 3 nodes on graph). I want to pass “links” value from Connections to “source” Domain. Is what possible? Thanks!
Yes I think that is possible. We can have a schema like this:
type Domain {
DomainID: ID!
source: [Domain]
target: [Domain]
}
With a schema like this you can connect domains without Connections type. In order to handle links you can use facet and also it is feasible to sort by facets. https://dgraph.io/docs/v21.03/query-language/facets/