Variant relations
Define variant types with relations
Variant types support entity relationship in a different way unlike the normal entity relationship. There are some limitations with variant relations:
Only one-to-many and many-to-one relations are supported
Reverse lookup is not supported
Let's take a look an example:
Schema: in the schema below there are two variant types with the relations
Mappings: insert data into database
For variant relations to work an additional field is added to variant type which is db only field (which means it is not visible in the graphql API). This field is will be generated from relation field name + 'id' ie. in the schema above relation name is event
so the auto generated field name is eventId
. This field is not optional and mapping author must set it properly.
Query: fetch all members'
source
:
Last updated