sdk
sdk copied to clipboard
Stop generating relationship `_type` values
createDirectRelationship
generates a _type
value, which seems convenient but it really isn't because the _type
values need to be declared in step definitions. This only causes confusion as developers need to uncover what the generated value would be to add it to the step definition.
One approach has been, in a constants file, to define the relationship type using the same generator used in createDirectRelationship
, and then refer to that constant in the step definition (and elsewhere):
const RELATIONSHIP_TYPE_THING_TO_WHATEVER = generateRelationshipType('HAS', 'aws_account', 'aws_instance');
However, this is "special knowledge" that must be discovered somehow. Instead, they should be able to just define the constant and be required to provide the _type: RELATIONSHIP_TYPE_THING_TO_WHATEVER
when creating relationships.