graphiti-api / graphiti_errors

MIT License
1 stars 8 forks source link

Relationship Paths For SprayPaint Compatibility #8

Open caseyprovost opened 5 years ago

caseyprovost commented 5 years ago

(adding this here for trackability/transparency)

Currently, Spraypaint expects relationship errors to be nested. GraphitiErrors does not provide this functionality. In talking with @wadetandy and @richmolj, we figured we could just add a path attribute to the relationship meta in order for SprayPaint and other clients to "walk the tree".

The idea would be:

Path Structure:

/relationship1_name|json_type|id/relationship2_name|json_type|id

Examples :

/person|people|1/contacts|contacts|23
/person|people|1/contacts|contacts|23/company_addresses|addresses|5
"meta": {
 "relationship": {
   "attribute": "name",
   "path": "/person|people|1/contacts|contacts|23"
   ...
 }
}
elDub commented 5 years ago

Just to add to the situation, when Graphiti returns errors for these deeper nested objects, Spraypaint aborts and results in irrecoverable client error. This isn't just a missing feature.

caseyprovost commented 5 years ago

@elDub absolutely! Definitely a bug