Created
April 28, 2018 02:18
-
-
Save jamesplease/05517540bea4b6ff0c37cf1703190459 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// These are the resource types in this relationship. | |
// In this case, both sides of the relationship are people. | |
resourceTypes: ['people'], | |
relationshipSchema: { | |
fields: { | |
father: { | |
resourceType: 'people', | |
}, | |
son: { | |
resourceType: 'author' | |
}, | |
}, | |
// this is necessary to define what | |
// one-to-one and one-to-many mean | |
// this is where the relationship was defined on the | |
// schema | |
host: 'people', | |
// one-to-one, one-to-many, many-to-many | |
type: 'one-to-many' | |
} | |
// Using this and the schema, we can piece the relationship back together | |
values: { | |
father: 1, | |
son: 5 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment