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

Commit

Permalink
feat: lots stuff or something
Browse files Browse the repository at this point in the history
- Fully implemented films
- Fixed enums for people, planets, species, starships
- Removed films enum as it is covered by class-validator
- Added GraphQLLong scalar
- Fixed various entries in the dataset because the swapi data is crap
- Updated playgrounds default tabs data
- Fixed various numbers that should be Float, not Int in GraphQL
- Updated GraphQLSet filter method to filter out the predicate value
  • Loading branch information
favna committed Jul 7, 2021
1 parent b5ed547 commit 55fd2da
Show file tree
Hide file tree
Showing 27 changed files with 460 additions and 243 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"#assets/*": "./generated/api/assets/*.js",
"#jsonAssets/*": "./generated/api/assets/*",
"#resolvers/*": "./generated/api/resolvers/*.js",
"#scalars/*": "./generated/api/scalars/*.js",
"#services/*": "./generated/api/services/*.js",
"#structures/*": "./generated/api/structures/*.js",
"#utils/*": "./generated/api/utils/*.js",
Expand Down
3 changes: 0 additions & 3 deletions src/arguments/FilmsArgs.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import filmData from '#assets/films';
import { IsIn, IsNumber } from 'class-validator';
import { ArgsType, Field, Int } from 'type-graphql';

export const films = filmData.enumObject();

@ArgsType()
export default class FilmArgs {
@Field(() => Int, { description: 'The film to look up, referenced by episode number' })
Expand Down
2 changes: 1 addition & 1 deletion src/arguments/PersonArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const people = personData.enumObject();

@ArgsType()
export default class PersonArgs {
@Field(() => String, { description: 'The person to look up' })
@Field(() => people, { description: 'The person to look up' })
@IsString()
public person!: string;
}
2 changes: 1 addition & 1 deletion src/arguments/PlanetArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const planets = planetData.enumObject();

@ArgsType()
export default class PlanetArgs {
@Field(() => String, { description: 'The planet to look up' })
@Field(() => planets, { description: 'The planet to look up' })
@IsString()
public planet!: string;
}
2 changes: 1 addition & 1 deletion src/arguments/SpeciesArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const species = speciesData.enumObject();

@ArgsType()
export default class SpeciesArgs {
@Field(() => String, { description: 'The species to look up' })
@Field(() => species, { description: 'The species to look up' })
@IsString()
public species!: string;
}
2 changes: 1 addition & 1 deletion src/arguments/StarshipArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const starships = starshipsData.enumObject();

@ArgsType()
export default class StarshipArgs {
@Field(() => String, { description: 'The starship to look up' })
@Field(() => starships, { description: 'The starship to look up' })
@IsString()
public starship!: string;
}
18 changes: 9 additions & 9 deletions src/assets/people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
hairColors: null,
height: 175,
homeworld: 'Nal Hutta',
mass: NaN,
mass: 1358,
name: 'Jabba Desilijic Tiure',
skinColors: ['green-tan', 'brown'],
species: ['hutt'],
Expand Down Expand Up @@ -598,7 +598,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
}
],
[
'padm├®amidala',
'padmeamidala',
{
birthYear: '46BBY',
eyeColors: ['brown'],
Expand All @@ -608,7 +608,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
height: 185,
homeworld: 'Naboo',
mass: 45,
name: 'Padm├® Amidala',
name: 'Padmé Amidala',
skinColors: ['light'],
species: [],
starships: ['naboofighter', 'htypenubianyacht', 'naboostarskiff'],
Expand Down Expand Up @@ -670,7 +670,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
}
],
[
'ricoli├®',
'ricolie',
{
birthYear: 'unknown',
eyeColors: ['blue'],
Expand All @@ -680,7 +680,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
height: 183,
homeworld: 'Naboo',
mass: null,
name: 'Ric Oli├®',
name: 'Ric Olié',
skinColors: ['fair'],
species: [],
starships: ['nabooroyalstarship'],
Expand Down Expand Up @@ -1066,7 +1066,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
}
],
[
'cord├®',
'corde',
{
birthYear: 'unknown',
eyeColors: ['brown'],
Expand All @@ -1076,7 +1076,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
height: 157,
homeworld: 'Naboo',
mass: null,
name: 'Cord├®',
name: 'Cordé',
skinColors: ['light'],
species: [],
starships: [],
Expand Down Expand Up @@ -1156,7 +1156,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
}
],
[
'dorm├®',
'dorme',
{
birthYear: 'unknown',
eyeColors: ['brown'],
Expand All @@ -1166,7 +1166,7 @@ export default new GraphQLCollection<string, StarWarsApi.Person>([
height: 165,
homeworld: 'Naboo',
mass: null,
name: 'Dorm├®',
name: 'Dormé',
skinColors: ['light'],
species: ['human'],
starships: [],
Expand Down
Loading

0 comments on commit 55fd2da

Please sign in to comment.