Can you specify one type to require fields of another type in schema

Hi Matt,
I may not have explained what I want to do properly. And I don’t have any data yet, just trying to create a schema to get an understanding of what all the parts mean and do.
So in the code in the post, I list three different types: coordinate, point, corridor. For the Coordinate type, I want any time it is used it has to have the lon and lat fields. I believe this is done by the ! at the end of the statement. Now you can see that the Point type has a coordinate field and I am requiring that to be filled in. When this type (Point) fills in the coordinate field, the field has to have the coordinate.lon and coordinate.lat fields filled in. I am still working through the mutation syntax. I have the standalone dgraph installed but the gui interface for it only accepts DQL format. So I apologize if this doesn’t make sense.

This mutation for adding a point is done like this because the lat and lon are required in the Coordinate type. For the Point type the hae, ce, and le fields are left empty and ignored by the Point type. So adding a Point to the graph will not throw an error if the hae, ce, and le fields are not filled in.

mutation addPoint{
“type”:“point”
“coordinates”: {
“lat”: 46.46777654
“lon”: 24.41249537
}
}

Now the corridor type also must have the hae, ce, and le fields filled in with a value in addition to the lat and lon fields. This is where I am not sure if it can be done. Here is a rough mutation example:

mutation addCorridor {
“type”:“corridor”
“point”: {
“coordinates”: {
“lon”: -118.98333333333333
“lat”: 46.46777654
“hae”: 8543.4
“ce”: 9999999
“le”: 9999999
}
}
}
Now when adding a Corridor object to the graph would be similar but it would require the hae, le, and ce fields of the Coordinate type. So now the add method would fail if the hae, ce, and le fields of the Coordinate type were not given a value.

Looking at this again though, I don’t think I can accomplish what I am trying to do with how i setup the types. Since Corridor type has a Point type instead of a Coordinate type I can’t make the fields required since it is going to go through the Point type when setting up the coordinates field.