-
-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Merge two directional relationships #243
Comments
Logically, you have books and authors to be cross-linked, but physically, you have a field that points to a type. |
I am not disagreeing with the principle, but the tool represents your physical schema/solution, not your business (would say domain) model.
yes and also no. Entity relationship still link, physically, fields, not table. Logically you link tables. GraphQL is not a graph database, actually has an own idea of the graph because it does not correctly (or fully) render edges, as opposed to a graph database where you have a clear notion of the edge. |
Our API is almost CRUD and the Data model and GraphQL are pretty much seamless. But I understand that this does not feel like the purpose of this plugin. Its a shame because this plugin is pretty awesome and and I can't find any other plugin that i could use to solve this. Maybe I will create a fork in the future for this purpose. And there is no chance that you could make the the component more pluggable in a way that could solve this? A little of topic, but I also had to manually remove some types and properties from the introspection that I didn't want to show. return {
data: {
__schema: filterIntrospection(result.data.__schema),
},
}; And my PO wanted me to change the color/opacity on some types. Feels like all of these could be solved with injectable callbacks, like this. <Voyager
workerURI={`${process.env.PUBLIC_URL}/voyager.worker.js`}
displayOptions={{
hideRoot: true,
}}
introspection={introspectionProvider}
typeFilter={(type: IntrospectionOutputTypeRef) => !(type.kind === 'OBJECT' && myHiddenTypes.includes(type.name))}
fieldFilter={(field: IntrospectionField) => !myHiddenFields.includes(field.name)}
relationshipMap={(relationship, node1, node2, schema) => { /* Return modified relationship with updated anchorsm, name, color, etc. */ }}
typeMap={(type, schema) => { /* Return modified type with updated name, color, etc. */ }}
/> |
Which technically is not the right pattern. I do not think Voyager should change because an anti pattern does not get rendered well. Voyager renders as GraphQL is defined and supposed to be used, so field points to a type. The messy set of arrows is possible even following the pattern, but in that case is intended.
I will test this, I am quite curious. |
In our project every relationship can be accessed from both nodes, which creates a lot of extra relationships in the graph that are actually the same relationships. Ideally the relationship should be represented by arrows on both sides, or no arrows, and connected to the correct property.
A problem with this is probably that there is no way to know this by just looking at the introspection. Just because there are multiple relationships between two nodes does not mean that they are the same. A solution to this could be to add it to the description in some way, like this:
The text was updated successfully, but these errors were encountered: