Skip to content
This repository has been archived by the owner on Aug 28, 2022. It is now read-only.

Commit

Permalink
fix: assign proper species to humans
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Jul 10, 2021
1 parent 76f2116 commit c9b7768
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 35 deletions.
66 changes: 33 additions & 33 deletions src/assets/people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 77,
name: 'Luke Skywalker',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: ['xwing', 'imperialshuttle'],
vehicles: ['snowspeeder', 'imperialspeederbike']
}
Expand Down Expand Up @@ -70,7 +70,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 136,
name: 'Darth Vader',
skinColors: ['white'],
species: [],
species: ['human'],
starships: ['tieadvancedx1'],
vehicles: []
}
Expand All @@ -88,7 +88,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 49,
name: 'Leia Organa',
skinColors: ['light'],
species: [],
species: ['human'],
starships: [],
vehicles: ['imperialspeederbike']
}
Expand All @@ -106,7 +106,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 120,
name: 'Owen Lars',
skinColors: ['light'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand All @@ -122,9 +122,9 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
height: 165,
homeworld: 'tatooine',
mass: 75,
name: 'Beru Whitesun lars',
name: 'Beru Whitesun Lars',
skinColors: ['light'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand Down Expand Up @@ -160,7 +160,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 84,
name: 'Biggs Darklighter',
skinColors: ['light'],
species: [],
species: ['human'],
starships: ['xwing'],
vehicles: []
}
Expand All @@ -178,7 +178,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 77,
name: 'Obi-Wan Kenobi',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: ['jedistarfighter', 'tradefederationcruiser', 'naboostarskiff', 'jediinterceptor', 'belbullab22starfighter'],
vehicles: ['tribubblebongo']
}
Expand All @@ -196,7 +196,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 84,
name: 'Anakin Skywalker',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: ['naboofighter', 'tradefederationcruiser', 'jediinterceptor'],
vehicles: ['zephyrgswoopbike', 'xj6airspeeder']
}
Expand All @@ -214,7 +214,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: null,
name: 'Wilhuff Tarkin',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand Down Expand Up @@ -250,7 +250,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 80,
name: 'Han Solo',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: ['millenniumfalcon', 'imperialshuttle'],
vehicles: []
}
Expand Down Expand Up @@ -304,7 +304,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 77,
name: 'Wedge Antilles',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: ['xwing'],
vehicles: ['snowspeeder']
}
Expand All @@ -322,7 +322,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 110,
name: 'Jek Tono Porkins',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: ['xwing'],
vehicles: []
}
Expand Down Expand Up @@ -358,7 +358,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 75,
name: 'Palpatine',
skinColors: ['pale'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand All @@ -376,7 +376,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 78.2,
name: 'Boba Fett',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: ['slave1'],
vehicles: []
}
Expand Down Expand Up @@ -430,7 +430,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 79,
name: 'Lando Calrissian',
skinColors: ['dark'],
species: [],
species: ['human'],
starships: ['millenniumfalcon'],
vehicles: []
}
Expand All @@ -448,7 +448,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 79,
name: 'Lobot',
skinColors: ['light'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand Down Expand Up @@ -484,7 +484,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: null,
name: 'Mon Mothma',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand All @@ -502,7 +502,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: null,
name: 'Arvel Crynyd',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: ['awing'],
vehicles: []
}
Expand Down Expand Up @@ -556,7 +556,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 89,
name: 'Qui-Gon Jinn',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: [],
vehicles: ['tribubblebongo']
}
Expand Down Expand Up @@ -592,7 +592,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: null,
name: 'Finis Valorum',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand All @@ -610,7 +610,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 45,
name: 'Padmé Amidala',
skinColors: ['light'],
species: [],
species: ['human'],
starships: ['naboofighter', 'htypenubianyacht', 'naboostarskiff'],
vehicles: []
}
Expand Down Expand Up @@ -682,7 +682,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: null,
name: 'Ric Olié',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: ['nabooroyalstarship'],
vehicles: []
}
Expand Down Expand Up @@ -736,7 +736,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: null,
name: 'Quarsh Panaka',
skinColors: ['dark'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand All @@ -754,7 +754,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: null,
name: 'Shmi Skywalker',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand Down Expand Up @@ -898,7 +898,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 84,
name: 'Mace Windu',
skinColors: ['dark'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand Down Expand Up @@ -1060,7 +1060,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 85,
name: 'Gregar Typho',
skinColors: ['dark'],
species: [],
species: ['human'],
starships: ['naboofighter'],
vehicles: []
}
Expand All @@ -1078,7 +1078,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: null,
name: 'Cordé',
skinColors: ['light'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand All @@ -1096,7 +1096,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: null,
name: 'Cliegg Lars',
skinColors: ['fair'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand Down Expand Up @@ -1222,7 +1222,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 79,
name: 'Jango Fett',
skinColors: ['tan'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand Down Expand Up @@ -1330,7 +1330,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: null,
name: 'R4-P17',
skinColors: ['silver', 'red'],
species: [],
species: ['droid'],
starships: [],
vehicles: []
}
Expand Down Expand Up @@ -1438,7 +1438,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 79,
name: 'Raymus Antilles',
skinColors: ['light'],
species: [],
species: ['human'],
starships: [],
vehicles: []
}
Expand All @@ -1456,7 +1456,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
mass: 48,
name: 'Sly Moore',
skinColors: ['pale'],
species: [],
species: ['umbaran'],
starships: [],
vehicles: []
}
Expand Down
17 changes: 17 additions & 0 deletions src/assets/species.ts
Original file line number Diff line number Diff line change
Expand Up @@ -631,5 +631,22 @@ export default new GraphQLCollection<string, StarWarsApi.Species>([
people: ['tionmedon'],
skinColors: ['grey']
}
],
[
'umbaran',
{
averageHeight: null,
averageLifespan: null,
classification: 'mammal',
designation: 'sentient',
eyeColors: ['white', 'pale blue'],
films: [2, 3],
hairColors: ['White'],
homeworld: 'umbara',
language: 'Umbarese',
name: 'Umbaran',
people: ['slymoore'],
skinColors: ['pale', 'bluish']
}
]
]);
4 changes: 2 additions & 2 deletions src/services/PersonService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export default class PersonService {
if (requestedFields.has('species')) {
const speciesFields = requestedFields.filterStartsWith<GraphQLSet<keyof Species>>('species.');

for (const filmSpecies of data.species) {
const speciesData = SpeciesService.getBySpeciesName({ species: filmSpecies })!;
for (const personSpecies of data.species) {
const speciesData = SpeciesService.getBySpeciesName({ species: personSpecies })!;
species.push(
SpeciesService.mapSpeciesDataToSpeciesGraphQL({
data: speciesData,
Expand Down

0 comments on commit c9b7768

Please sign in to comment.