| giolekva | b0b7f00 | 2020-04-16 16:05:40 +0400 | [diff] [blame^] | 1 | enum EntityType { |
| 2 | HUMAN | ||||
| 3 | CAR | ||||
| 4 | } | ||||
| 5 | |||||
| 6 | type Person { | ||||
| 7 | id: Int! | ||||
| 8 | fullName: String! | ||||
| 9 | nick: String | ||||
| 10 | imgs: [Image] | ||||
| 11 | } | ||||
| 12 | |||||
| 13 | type Image { | ||||
| 14 | id: Int! @search | ||||
| 15 | objectPath: String! @search(by: [term]) | ||||
| 16 | segments: [ImageSegment] | ||||
| 17 | } | ||||
| 18 | |||||
| 19 | type Point { | ||||
| 20 | x: Int! | ||||
| 21 | y: Int! | ||||
| 22 | } | ||||
| 23 | |||||
| 24 | type ImageSegment { | ||||
| 25 | id: Int! | ||||
| 26 | upperLeft: Point! | ||||
| 27 | lowerRight: Point! | ||||
| 28 | represents: EntityType | ||||
| 29 | depicts: Person | ||||
| 30 | } | ||||
| 31 | |||||
| 32 | type A { | ||||
| 33 | id: ID! | ||||
| 34 | } | ||||
| 35 | |||||
| 36 | type B { | ||||
| 37 | id: ID! | ||||
| 38 | name: String | ||||
| 39 | a: [A] | ||||
| 40 | } | ||||
| 41 | |||||
| 42 | extend type A { | ||||
| 43 | name: String @search(by: [term]) | ||||
| 44 | b: B @hasInverse(field: a) | ||||
| 45 | |||||
| 46 | } | ||||