@tmdb-graphql-api/resolvers 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tmdb-graphql-api/resolvers",
3
3
  "description": "The TMDB GraphQL resolvers module.",
4
- "version": "0.0.11",
4
+ "version": "0.0.13",
5
5
  "author": "Dylan Aubrey",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/badbatch/themoviedb-graphql-api",
@@ -40,7 +40,7 @@
40
40
  "query-string": "^8.1.0",
41
41
  "type-fest": "^4.5.0",
42
42
  "@tmdb-graphql-api/rest-client": "0.0.7",
43
- "@tmdb-graphql-api/schema": "0.0.9"
43
+ "@tmdb-graphql-api/schema": "0.0.10"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@babel/runtime": "<8",
package/src/queries/tv.ts CHANGED
@@ -47,8 +47,13 @@ const appendToResponse = {
47
47
  };
48
48
 
49
49
  const enrichSeasonData = (obj: RawTv) => {
50
- for (const season of obj.seasons) {
51
- season.tv_show_id = obj.id;
50
+ // Although RawTv should always have seasons there are some
51
+ // instances where this is undefined and causes an exception.
52
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
53
+ if (obj.seasons) {
54
+ for (const season of obj.seasons) {
55
+ season.tv_show_id = obj.id;
56
+ }
52
57
  }
53
58
  };
54
59
 
package/src/types.ts CHANGED
@@ -414,7 +414,7 @@ export type RawTv = SnakeCasedPropertiesDeep<
414
414
  | 'videos'
415
415
  | 'watchProviders'
416
416
  >
417
- > & { seasons: RawSeason[] };
417
+ > & { seasons?: RawSeason[] };
418
418
 
419
419
  export type RawTvWithAppendToResponse = RawTv & {
420
420
  alternative_titles: Omit<RawTvAlternativeTitles, 'id'>;