Hello All!
I am first time using DGraph. I would love if anyone could review my schema.
It’s a very basic use case where I have two types of nodes: Tag and Resource. I want to keep the edges unidirectional, as I would query from both sides.
Additionally, I would often do an exact match on the ‘parentId’ field and ‘anyofterms’ on the key field.
You are mixing the DQL and GraphQL syntaxes here. This is not a valid schema. What are you placing to use primarily DQL or GraphQL to mutate and query your data?
Hi,
Thank you for your reply. I’ve started some implementation using DQL. I’ve been loading this schema so far and DGraph hasn’t complained about it yet.
I’m flexible with my backend implementation. I can go with either. Does DQL have performance benefits? If yes, what changes can be made it to make more efficient.
What is your use case for parentId? Is this going to be used to look up something else? If so, it should be an edge not a predicate.
Are you going to want to keep resouceIds and tagIds in sync yourself manually? It might be easier to use just the reverse edge for whichever side seems more natural. I would keep the actual edge on the side where you write to most usually. (The primary type)
Thank you for your response. ParentId will be mainly used for lookups. You can think of it as n tags associated with one parent ID. How can I make it an edge?
In my implementation currently, I was syncing them manually. Is there a better way to do that? I would mostly write to resourceIds and update tagIds later. Can you help me with I would keep the actual edge on the side where you write to most usually. (The primary type) part?