File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -129,25 +129,29 @@ class Character {
129
129
}
130
130
131
131
class Human extends Character {
132
- __typename : string ;
133
132
homePlanet : string ;
134
133
135
134
constructor ( data : HumanData ) {
136
135
super ( data ) ;
137
- this . __typename = 'Human' ;
138
136
this . homePlanet = data . homePlanet ;
139
137
}
138
+
139
+ get __typename ( ) : string {
140
+ return 'Human' ;
141
+ }
140
142
}
141
143
142
144
class Droid extends Character {
143
- __typename : string ;
144
145
primaryFunction : string ;
145
146
146
147
constructor ( data : DroidData ) {
147
148
super ( data ) ;
148
- this . __typename = 'Droid' ;
149
149
this . primaryFunction = data . primaryFunction ;
150
150
}
151
+
152
+ get __typename ( ) : string {
153
+ return 'Droid' ;
154
+ }
151
155
}
152
156
153
157
function makeCharacterObj ( data : CharacterData ) {
You can’t perform that action at this time.
0 commit comments