@tmdb-graphql-api/resolvers 0.1.2-unstable.9 → 0.1.2

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.
Files changed (85) hide show
  1. package/dist/cjs/index.cjs +1 -1
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/index.mjs +1 -1
  4. package/dist/esm/index.mjs.map +1 -1
  5. package/dist/production.analysis.txt +291 -287
  6. package/dist/types/cjs/constants.d.cts +11 -0
  7. package/dist/types/cjs/constants.d.cts.map +1 -1
  8. package/dist/types/cjs/helpers/buildArgsResolver.d.cts +2 -1
  9. package/dist/types/cjs/helpers/buildArgsResolver.d.cts.map +1 -1
  10. package/dist/types/cjs/helpers/buildNoObjArgsResolver.d.cts +2 -1
  11. package/dist/types/cjs/helpers/buildNoObjArgsResolver.d.cts.map +1 -1
  12. package/dist/types/cjs/helpers/buildObjArgsResolver.d.cts +2 -1
  13. package/dist/types/cjs/helpers/buildObjArgsResolver.d.cts.map +1 -1
  14. package/dist/types/cjs/helpers/buildObjResolver.d.cts +2 -1
  15. package/dist/types/cjs/helpers/buildObjResolver.d.cts.map +1 -1
  16. package/dist/types/cjs/queries/movie.d.cts.map +1 -1
  17. package/dist/types/cjs/queries/person.d.cts.map +1 -1
  18. package/dist/types/cjs/queries/season.d.cts.map +1 -1
  19. package/dist/types/cjs/queries/tv.d.cts.map +1 -1
  20. package/dist/types/esm/constants.d.ts +11 -0
  21. package/dist/types/esm/constants.d.ts.map +1 -1
  22. package/dist/types/esm/helpers/buildArgsResolver.d.ts +2 -1
  23. package/dist/types/esm/helpers/buildArgsResolver.d.ts.map +1 -1
  24. package/dist/types/esm/helpers/buildNoObjArgsResolver.d.ts +2 -1
  25. package/dist/types/esm/helpers/buildNoObjArgsResolver.d.ts.map +1 -1
  26. package/dist/types/esm/helpers/buildObjArgsResolver.d.ts +2 -1
  27. package/dist/types/esm/helpers/buildObjArgsResolver.d.ts.map +1 -1
  28. package/dist/types/esm/helpers/buildObjResolver.d.ts +2 -1
  29. package/dist/types/esm/helpers/buildObjResolver.d.ts.map +1 -1
  30. package/dist/types/esm/queries/movie.d.ts.map +1 -1
  31. package/dist/types/esm/queries/person.d.ts.map +1 -1
  32. package/dist/types/esm/queries/season.d.ts.map +1 -1
  33. package/dist/types/esm/queries/tv.d.ts.map +1 -1
  34. package/dist/types/tsconfig.build.tsbuildinfo +1 -1
  35. package/package.json +8 -8
  36. package/src/constants.ts +13 -0
  37. package/src/helpers/buildArgsResolver.ts +6 -2
  38. package/src/helpers/buildNoObjArgsResolver.ts +6 -2
  39. package/src/helpers/buildObjArgsResolver.ts +11 -4
  40. package/src/helpers/buildObjResolver.ts +6 -2
  41. package/src/queries/collection.ts +2 -2
  42. package/src/queries/company.ts +2 -2
  43. package/src/queries/episode.ts +2 -2
  44. package/src/queries/episodeCredits.ts +2 -2
  45. package/src/queries/episodeExternalIds.ts +2 -2
  46. package/src/queries/episodeStills.ts +2 -2
  47. package/src/queries/episodeTranslations.ts +2 -2
  48. package/src/queries/episodeVideos.ts +2 -2
  49. package/src/queries/movie.ts +2 -1
  50. package/src/queries/movieAlternativeTitles.ts +2 -2
  51. package/src/queries/movieCredits.ts +2 -2
  52. package/src/queries/movieExternalIds.ts +2 -2
  53. package/src/queries/movieImages.ts +2 -2
  54. package/src/queries/movieKeywords.ts +2 -2
  55. package/src/queries/movieReleaseDates.ts +2 -2
  56. package/src/queries/movieReviews.ts +2 -2
  57. package/src/queries/movieTranslations.ts +2 -2
  58. package/src/queries/movieVideos.ts +2 -2
  59. package/src/queries/movieWatchProviders.ts +2 -2
  60. package/src/queries/network.ts +2 -2
  61. package/src/queries/person.ts +2 -1
  62. package/src/queries/personCombinedCredits.ts +2 -2
  63. package/src/queries/personExternalIds.ts +2 -2
  64. package/src/queries/personMovieCredits.ts +2 -2
  65. package/src/queries/personProfiles.ts +2 -2
  66. package/src/queries/personTranslations.ts +2 -2
  67. package/src/queries/personTvCredits.ts +2 -2
  68. package/src/queries/review.ts +2 -2
  69. package/src/queries/season.ts +13 -2
  70. package/src/queries/seasonCredits.ts +2 -2
  71. package/src/queries/seasonExternalIds.ts +2 -2
  72. package/src/queries/seasonPosters.ts +2 -2
  73. package/src/queries/seasonTranslations.ts +2 -2
  74. package/src/queries/seasonVideos.ts +2 -2
  75. package/src/queries/tv.ts +2 -1
  76. package/src/queries/tvAlternativeTitles.ts +2 -2
  77. package/src/queries/tvContentRatings.ts +2 -2
  78. package/src/queries/tvCredits.ts +2 -2
  79. package/src/queries/tvEpisodeGroups.ts +2 -2
  80. package/src/queries/tvExternalIds.ts +2 -2
  81. package/src/queries/tvImages.ts +2 -2
  82. package/src/queries/tvKeywords.ts +2 -2
  83. package/src/queries/tvTranslations.ts +2 -2
  84. package/src/queries/tvVideos.ts +2 -2
  85. package/src/queries/tvWatchProviders.ts +2 -2
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.1.2-unstable.9",
4
+ "version": "0.1.2",
5
5
  "author": "Dylan Aubrey",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/badbatch/themoviedb-graphql-api",
@@ -32,16 +32,16 @@
32
32
  "@cachemap/core": "^5.2.7",
33
33
  "@cachemap/map": "^5.0.9",
34
34
  "@cachemap/reaper": "^5.1.3",
35
- "@graphql-box/connection-resolver": "^5.4.10",
36
- "@graphql-box/core": "^5.4.4",
35
+ "@graphql-box/connection-resolver": "^5.4.17",
36
+ "@graphql-box/core": "^5.4.6",
37
37
  "cacheability": "^4.0.27",
38
- "getta": "^1.0.14",
38
+ "getta": "^1.0.15",
39
39
  "js-base64": "^3.6.0",
40
40
  "query-string": "^8.1.0",
41
41
  "type-fest": "^4.37.0",
42
42
  "winston": "^3.17.0",
43
- "@tmdb-graphql-api/rest-client": "0.0.11-unstable.6",
44
- "@tmdb-graphql-api/schema": "0.1.1-unstable.1"
43
+ "@tmdb-graphql-api/rest-client": "0.0.11",
44
+ "@tmdb-graphql-api/schema": "0.1.1"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@babel/runtime": "<8",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@babel/runtime": "^7.23.2",
54
- "@graphql-box/helpers": "^5.4.4",
54
+ "@graphql-box/helpers": "^5.4.6",
55
55
  "@jest/globals": "^29.7.0",
56
56
  "@types/lodash-es": "^4.14.191",
57
57
  "core-js": "^3.33.1",
@@ -60,7 +60,7 @@
60
60
  "fetch-mocked": "^0.0.27",
61
61
  "graphql": "^16.10.0",
62
62
  "lodash-es": "^4.17.21",
63
- "@tmdb-graphql-api/test-utils": "0.1.0"
63
+ "@tmdb-graphql-api/test-utils": "0.1.1"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "pnpm run clean:dist && pnpm run compile",
package/src/constants.ts CHANGED
@@ -72,3 +72,16 @@ export const VIDEOS = 'videos' as const;
72
72
 
73
73
  export const WATCH_PROVIDERS = 'watchProviders' as const;
74
74
  export const RAW_WATCH_PROVIDERS = 'watch/providers' as const;
75
+
76
+ export enum ResolverType {
77
+ Args = 'ARGS',
78
+ Obj = 'OBJ',
79
+ ObjAndArgs = 'OBJ_AND_ARGS',
80
+ OptsObjAndArgs = 'OPTS_OBJ_AND_ARGS',
81
+ }
82
+
83
+ export enum Source {
84
+ Api = 'api',
85
+ Cache = 'cache',
86
+ ParentNode = 'parentNode',
87
+ }
@@ -1,4 +1,6 @@
1
1
  import { GraphQLError, type GraphQLResolveInfo } from 'graphql';
2
+ import crypto from 'node:crypto';
3
+ import { ResolverType, type Source } from '../constants.ts';
2
4
  import { type Context } from '../types.ts';
3
5
 
4
6
  export const buildArgsResolver =
@@ -8,7 +10,7 @@ export const buildArgsResolver =
8
10
  args: Args,
9
11
  ctx: Context,
10
12
  info: GraphQLResolveInfo
11
- ) => Promise<{ data?: Data; errors?: Error[]; headers: Headers; source?: string }>
13
+ ) => Promise<{ data?: Data; errors?: Error[]; headers: Headers; source?: Source }>
12
14
  ) =>
13
15
  async (_obj: undefined, args: Args, ctx: Context, info: GraphQLResolveInfo) => {
14
16
  const { logger, setCacheMetadata } = ctx;
@@ -20,6 +22,8 @@ export const buildArgsResolver =
20
22
  ...ctx.data,
21
23
  args,
22
24
  fieldPath: fieldName,
25
+ resolverRequestId: crypto.randomUUID(),
26
+ resolverType: ResolverType.Args,
23
27
  },
24
28
  };
25
29
 
@@ -30,7 +34,7 @@ export const buildArgsResolver =
30
34
 
31
35
  if (errors?.length) {
32
36
  const message = `Failed to resolve ${fieldName}`;
33
- childLogger.error(message, { errors, logEntryName: 'RESOLVER_FAILED' });
37
+ childLogger.error(message, { errors: JSON.stringify(errors), logEntryName: 'RESOLVER_FAILED' });
34
38
  throw new GraphQLError(message, { nodes: fieldNodes, originalError: errors[0] });
35
39
  }
36
40
 
@@ -1,4 +1,6 @@
1
1
  import { GraphQLError, type GraphQLResolveInfo } from 'graphql';
2
+ import crypto from 'node:crypto';
3
+ import { ResolverType, type Source } from '../constants.ts';
2
4
  import type { Context } from '../types.ts';
3
5
 
4
6
  export const buildNoObjArgsResolver =
@@ -7,7 +9,7 @@ export const buildNoObjArgsResolver =
7
9
  callback: (
8
10
  ctx: Context,
9
11
  info: GraphQLResolveInfo
10
- ) => Promise<{ data?: Data; errors?: Error[]; headers: Headers; source?: string }>
12
+ ) => Promise<{ data?: Data; errors?: Error[]; headers: Headers; source?: Source }>
11
13
  ) =>
12
14
  async (obj: Obj | undefined, _args: undefined, ctx: Context, info: GraphQLResolveInfo) => {
13
15
  const { logger, setCacheMetadata } = ctx;
@@ -19,6 +21,8 @@ export const buildNoObjArgsResolver =
19
21
  data: {
20
22
  ...ctx.data,
21
23
  fieldPath,
24
+ resolverRequestId: crypto.randomUUID(),
25
+ resolverType: ResolverType.OptsObjAndArgs,
22
26
  },
23
27
  };
24
28
 
@@ -28,7 +32,7 @@ export const buildNoObjArgsResolver =
28
32
 
29
33
  if (errors?.length) {
30
34
  const message = `Failed to resolve ${fieldPath}`;
31
- childLogger.error(message, { errors, logEntryName: 'RESOLVER_FAILED' });
35
+ childLogger.error(message, { errors: JSON.stringify(errors), logEntryName: 'RESOLVER_FAILED' });
32
36
  throw new GraphQLError(message, { nodes: fieldNodes, originalError: errors[0] });
33
37
  }
34
38
 
@@ -1,4 +1,7 @@
1
1
  import { GraphQLError, type GraphQLResolveInfo } from 'graphql';
2
+ import { isUndefined, snakeCase } from 'lodash-es';
3
+ import crypto from 'node:crypto';
4
+ import { ResolverType, type Source } from '../constants.ts';
2
5
  import { type Context } from '../types.ts';
3
6
 
4
7
  export const buildObjArgsResolver =
@@ -9,7 +12,7 @@ export const buildObjArgsResolver =
9
12
  args: Args,
10
13
  ctx: Context,
11
14
  info: GraphQLResolveInfo
12
- ) => Promise<{ data?: Data; errors?: Error[]; headers?: Headers; source?: string }>
15
+ ) => Promise<{ data?: Data; errors?: Error[]; headers?: Headers; source?: Source }>
13
16
  ) =>
14
17
  async (obj: Obj | undefined, args: Args, ctx: Context, info: GraphQLResolveInfo) => {
15
18
  const { logger, setCacheMetadata } = ctx;
@@ -21,12 +24,13 @@ export const buildObjArgsResolver =
21
24
  data: {
22
25
  ...ctx.data,
23
26
  args,
24
- fieldPath,
27
+ fieldPath: parentFieldName,
28
+ resolverRequestId: crypto.randomUUID(),
29
+ resolverType: ResolverType.ObjAndArgs,
25
30
  },
26
31
  };
27
32
 
28
33
  const childLogger = logger.child(newCtx.data);
29
- const loggingEnabled = !obj || fieldName === 'id';
30
34
  const id = obj && 'id' in obj && obj.id ? obj.id : 'id' in args ? args.id : undefined;
31
35
 
32
36
  const enrichLogMessage = (message: string) => {
@@ -34,6 +38,9 @@ export const buildObjArgsResolver =
34
38
  return id ? `${enrichedMessage} ${String(id)}` : enrichedMessage;
35
39
  };
36
40
 
41
+ const typedFieldName = snakeCase(fieldName) as keyof Obj;
42
+ const loggingEnabled = !(obj && !isUndefined(obj[typedFieldName]));
43
+
37
44
  if (loggingEnabled) {
38
45
  childLogger.info(enrichLogMessage('Resolving'), { logEntryName: 'RESOLVER_START' });
39
46
  }
@@ -44,7 +51,7 @@ export const buildObjArgsResolver =
44
51
  const message = enrichLogMessage('Failed to resolve');
45
52
 
46
53
  if (loggingEnabled) {
47
- childLogger.error(message, { errors, logEntryName: 'RESOLVER_FAILED' });
54
+ childLogger.error(message, { errors: JSON.stringify(errors), logEntryName: 'RESOLVER_FAILED' });
48
55
  }
49
56
 
50
57
  throw new GraphQLError(message, { nodes: fieldNodes, originalError: errors[0] });
@@ -1,4 +1,6 @@
1
1
  import { GraphQLError, type GraphQLResolveInfo } from 'graphql';
2
+ import crypto from 'node:crypto';
3
+ import { ResolverType, type Source } from '../constants.ts';
2
4
  import { type Context } from '../types.ts';
3
5
 
4
6
  export const buildObjResolver =
@@ -8,7 +10,7 @@ export const buildObjResolver =
8
10
  obj: Obj,
9
11
  ctx: Context,
10
12
  info: GraphQLResolveInfo
11
- ) => Promise<{ data?: Data; errors?: Error[]; headers?: Headers; source?: string }>
13
+ ) => Promise<{ data?: Data; errors?: Error[]; headers?: Headers; source?: Source }>
12
14
  ) =>
13
15
  async (obj: Obj | undefined, _args: undefined, ctx: Context, info: GraphQLResolveInfo) => {
14
16
  const { logger, setCacheMetadata } = ctx;
@@ -21,6 +23,8 @@ export const buildObjResolver =
21
23
  ...ctx.data,
22
24
  fieldPath,
23
25
  parentFieldId: obj?.id,
26
+ resolverRequestId: crypto.randomUUID(),
27
+ resolverType: ResolverType.Obj,
24
28
  },
25
29
  };
26
30
 
@@ -37,7 +41,7 @@ export const buildObjResolver =
37
41
 
38
42
  if (errors?.length) {
39
43
  const message = `Failed to resolve ${fieldPath}`;
40
- childLogger.error(message, { errors, logEntryName: 'RESOLVER_FAILED' });
44
+ childLogger.error(message, { errors: JSON.stringify(errors), logEntryName: 'RESOLVER_FAILED' });
41
45
  throw new GraphQLError(message, { nodes: fieldNodes, originalError: errors[0] });
42
46
  }
43
47
 
@@ -1,6 +1,6 @@
1
1
  import { type QueryCollectionArgs } from '@tmdb-graphql-api/schema/types';
2
2
  import { isUndefined, snakeCase } from 'lodash-es';
3
- import { COLLECTION } from '../constants.ts';
3
+ import { COLLECTION, Source } from '../constants.ts';
4
4
  import { buildObjArgsResolver } from '../helpers/buildObjArgsResolver.ts';
5
5
  import { type RawCollection } from '../types.ts';
6
6
 
@@ -17,7 +17,7 @@ export const resolveCollection = buildObjArgsResolver<
17
17
  if (obj && !isUndefined(obj[typedFieldName])) {
18
18
  return {
19
19
  data: obj[typedFieldName],
20
- source: 'parentNode',
20
+ source: Source.ParentNode,
21
21
  };
22
22
  }
23
23
 
@@ -1,6 +1,6 @@
1
1
  import { type QueryCompanyArgs } from '@tmdb-graphql-api/schema/types';
2
2
  import { isUndefined, snakeCase } from 'lodash-es';
3
- import { COMPANY } from '../constants.ts';
3
+ import { COMPANY, Source } from '../constants.ts';
4
4
  import { buildObjArgsResolver } from '../helpers/buildObjArgsResolver.ts';
5
5
  import { type RawCompany } from '../types.ts';
6
6
 
@@ -17,7 +17,7 @@ export const resolveCompany = buildObjArgsResolver<
17
17
  if (obj && !isUndefined(obj[typedFieldName])) {
18
18
  return {
19
19
  data: obj[typedFieldName],
20
- source: 'parentNode',
20
+ source: Source.ParentNode,
21
21
  };
22
22
  }
23
23
 
@@ -1,6 +1,6 @@
1
1
  import { type QueryEpisodeArgs } from '@tmdb-graphql-api/schema/types';
2
2
  import { isUndefined, snakeCase } from 'lodash-es';
3
- import { CREDITS, EPISODE, EXTERNAL_IDS, IMAGES, TRANSLATIONS, VIDEOS } from '../constants.ts';
3
+ import { CREDITS, EPISODE, EXTERNAL_IDS, IMAGES, Source, TRANSLATIONS, VIDEOS } from '../constants.ts';
4
4
  import { buildObjArgsResolver } from '../helpers/buildObjArgsResolver.ts';
5
5
  import { encodeId } from '../helpers/encodeId.ts';
6
6
  import { getAppendToResponseKeys } from '../helpers/getAppendToResponseKeys.ts';
@@ -34,7 +34,7 @@ export const resolveEpisode = buildObjArgsResolver<
34
34
  typedFieldName === 'id'
35
35
  ? encodeId({ id, seasonNumber, ...(episodeNumber ? { episodeNumber } : {}) })
36
36
  : obj[typedFieldName],
37
- source: 'parentNode',
37
+ source: Source.ParentNode,
38
38
  };
39
39
  }
40
40
 
@@ -1,5 +1,5 @@
1
1
  import { snakeCase } from 'lodash-es';
2
- import { CREDITS, EPISODE } from '../constants.ts';
2
+ import { CREDITS, EPISODE, Source } from '../constants.ts';
3
3
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
4
4
  import {
5
5
  type EnrichedRawEpisode,
@@ -23,7 +23,7 @@ export const resolveEpisodeCredits = buildObjResolver<
23
23
  return {
24
24
  data: obj.credits?.[typedFieldName],
25
25
  headers: obj.__headers,
26
- source: 'parentNode',
26
+ source: Source.ParentNode,
27
27
  };
28
28
  }
29
29
 
@@ -1,6 +1,6 @@
1
1
  import { snakeCase } from 'lodash-es';
2
2
  import type { Except } from 'type-fest';
3
- import { EPISODE, EXTERNAL_IDS } from '../constants.ts';
3
+ import { EPISODE, EXTERNAL_IDS, Source } from '../constants.ts';
4
4
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
5
5
  import {
6
6
  type EnrichedRawEpisode,
@@ -25,7 +25,7 @@ export const resolveEpisodeExternalIds = buildObjResolver<
25
25
  return {
26
26
  data: obj[typedFieldName],
27
27
  headers: obj.__headers,
28
- source: 'parentNode',
28
+ source: Source.ParentNode,
29
29
  };
30
30
  }
31
31
 
@@ -1,5 +1,5 @@
1
1
  import { snakeCase } from 'lodash-es';
2
- import { EPISODE, IMAGES } from '../constants.ts';
2
+ import { EPISODE, IMAGES, Source } from '../constants.ts';
3
3
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
4
4
  import {
5
5
  type EnrichedRawEpisode,
@@ -23,7 +23,7 @@ export const resolveEpisodeStills = buildObjResolver<
23
23
  return {
24
24
  data: obj.images?.[typedFieldName],
25
25
  headers: obj.__headers,
26
- source: 'parentNode',
26
+ source: Source.ParentNode,
27
27
  };
28
28
  }
29
29
 
@@ -1,4 +1,4 @@
1
- import { EPISODE, TRANSLATIONS } from '../constants.ts';
1
+ import { EPISODE, Source, TRANSLATIONS } from '../constants.ts';
2
2
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
3
3
  import {
4
4
  type EnrichedRawEpisode,
@@ -20,7 +20,7 @@ export const resolveEpisodeTranslations = buildObjResolver<
20
20
  return {
21
21
  data: obj.translations?.translations,
22
22
  headers: obj.__headers,
23
- source: 'parentNode',
23
+ source: Source.ParentNode,
24
24
  };
25
25
  }
26
26
 
@@ -1,4 +1,4 @@
1
- import { EPISODE, VIDEOS } from '../constants.ts';
1
+ import { EPISODE, Source, VIDEOS } from '../constants.ts';
2
2
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
3
3
  import {
4
4
  type EnrichedRawEpisode,
@@ -20,7 +20,7 @@ export const resolveEpisodeVideos = buildObjResolver<
20
20
  return {
21
21
  data: obj.videos?.results,
22
22
  headers: obj.__headers,
23
- source: 'parentNode',
23
+ source: Source.ParentNode,
24
24
  };
25
25
  }
26
26
 
@@ -17,6 +17,7 @@ import {
17
17
  REVIEWS,
18
18
  SIMILAR,
19
19
  SIMILAR_MOVIES,
20
+ Source,
20
21
  TRANSLATIONS,
21
22
  VIDEOS,
22
23
  WATCH_PROVIDERS,
@@ -56,7 +57,7 @@ export const resolveMovie = buildObjArgsResolver<
56
57
  if (obj && !isUndefined(obj[typedFieldName])) {
57
58
  return {
58
59
  data: obj[typedFieldName],
59
- source: 'parentNode',
60
+ source: Source.ParentNode,
60
61
  };
61
62
  }
62
63
 
@@ -1,7 +1,7 @@
1
1
  import { type MovieAlternativeTitlesArgs } from '@tmdb-graphql-api/schema/types';
2
2
  import { GraphQLError } from 'graphql';
3
3
  import { snakeCase } from 'lodash-es';
4
- import { ALTERNATIVE_TITLES, MOVIE } from '../constants.ts';
4
+ import { ALTERNATIVE_TITLES, MOVIE, Source } from '../constants.ts';
5
5
  import { buildObjArgsResolver } from '../helpers/buildObjArgsResolver.ts';
6
6
  import { type RawMovie, type RawMovieAlternativeTitles, type RawMovieWithAppendToResponse } from '../types.ts';
7
7
 
@@ -29,7 +29,7 @@ export const resolveMovieAlternativeTitles = buildObjArgsResolver<
29
29
  return {
30
30
  data: obj.alternative_titles?.titles,
31
31
  headers: obj.__headers,
32
- source: 'parentNode',
32
+ source: Source.ParentNode,
33
33
  };
34
34
  }
35
35
 
@@ -1,4 +1,4 @@
1
- import { CREDITS, MOVIE } from '../constants.ts';
1
+ import { CREDITS, MOVIE, Source } from '../constants.ts';
2
2
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
3
3
  import { type RawMovie, type RawMovieCredits, type RawMovieWithAppendToResponse } from '../types.ts';
4
4
 
@@ -18,7 +18,7 @@ export const resolveMovieCredits = buildObjResolver<
18
18
  return {
19
19
  data: obj.credits?.[typedFieldName],
20
20
  headers: obj.__headers,
21
- source: 'parentNode',
21
+ source: Source.ParentNode,
22
22
  };
23
23
  }
24
24
 
@@ -1,6 +1,6 @@
1
1
  import { snakeCase } from 'lodash-es';
2
2
  import type { Except } from 'type-fest';
3
- import { EXTERNAL_IDS, MOVIE } from '../constants.ts';
3
+ import { EXTERNAL_IDS, MOVIE, Source } from '../constants.ts';
4
4
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
5
5
  import { type RawMovie, type RawMovieExternalIds, type RawMovieWithAppendToResponse } from '../types.ts';
6
6
 
@@ -18,7 +18,7 @@ export const resolveMovieExternalIds = buildObjResolver<
18
18
  return {
19
19
  data: obj.external_ids,
20
20
  headers: obj.__headers,
21
- source: 'parentNode',
21
+ source: Source.ParentNode,
22
22
  };
23
23
  }
24
24
 
@@ -1,4 +1,4 @@
1
- import { IMAGES, MOVIE } from '../constants.ts';
1
+ import { IMAGES, MOVIE, Source } from '../constants.ts';
2
2
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
3
3
  import { type RawMovie, type RawMovieImages, type RawMovieWithAppendToResponse } from '../types.ts';
4
4
 
@@ -18,7 +18,7 @@ export const resolveMovieImages = buildObjResolver<
18
18
  return {
19
19
  data: obj.images?.[typedFieldName],
20
20
  headers: obj.__headers,
21
- source: 'parentNode',
21
+ source: Source.ParentNode,
22
22
  };
23
23
  }
24
24
 
@@ -1,4 +1,4 @@
1
- import { KEYWORDS, MOVIE } from '../constants.ts';
1
+ import { KEYWORDS, MOVIE, Source } from '../constants.ts';
2
2
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
3
3
  import { type RawMovie, type RawMovieKeywords, type RawMovieWithAppendToResponse } from '../types.ts';
4
4
 
@@ -16,7 +16,7 @@ export const resolveMovieKeywords = buildObjResolver<
16
16
  return {
17
17
  data: obj.keywords?.keywords,
18
18
  headers: obj.__headers,
19
- source: 'parentNode',
19
+ source: Source.ParentNode,
20
20
  };
21
21
  }
22
22
 
@@ -1,5 +1,5 @@
1
1
  import { snakeCase } from 'lodash-es';
2
- import { MOVIE, RELEASE_DATES } from '../constants.ts';
2
+ import { MOVIE, RELEASE_DATES, Source } from '../constants.ts';
3
3
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
4
4
  import { type RawMovie, type RawMovieReleaseDates, type RawMovieWithAppendToResponse } from '../types.ts';
5
5
 
@@ -18,7 +18,7 @@ export const resolveMovieReleaseDates = buildObjResolver<
18
18
  return {
19
19
  data: obj.release_dates?.results,
20
20
  headers: obj.__headers,
21
- source: 'parentNode',
21
+ source: Source.ParentNode,
22
22
  };
23
23
  }
24
24
 
@@ -4,7 +4,7 @@ import { init as reaper } from '@cachemap/reaper';
4
4
  import { type CreateResourceResolver, type Getters, makeConnectionResolver } from '@graphql-box/connection-resolver';
5
5
  import { type MovieReviewsArgs } from '@tmdb-graphql-api/schema/types';
6
6
  import { encode } from 'js-base64';
7
- import { MOVIE, REVIEWS } from '../constants.ts';
7
+ import { MOVIE, REVIEWS, Source } from '../constants.ts';
8
8
  import {
9
9
  type Context,
10
10
  type RawMovie,
@@ -42,7 +42,7 @@ export const createResourceResolver: CreateResourceResolver<
42
42
  return {
43
43
  data: obj.reviews,
44
44
  headers: obj.__headers,
45
- source: 'parentNode',
45
+ source: Source.ParentNode,
46
46
  };
47
47
  }
48
48
 
@@ -1,4 +1,4 @@
1
- import { MOVIE, TRANSLATIONS } from '../constants.ts';
1
+ import { MOVIE, Source, TRANSLATIONS } from '../constants.ts';
2
2
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
3
3
  import { type RawMovie, type RawMovieTranslations, type RawMovieWithAppendToResponse } from '../types.ts';
4
4
 
@@ -16,7 +16,7 @@ export const resolveMovieTranslations = buildObjResolver<
16
16
  return {
17
17
  data: obj.translations?.translations,
18
18
  headers: obj.__headers,
19
- source: 'parentNode',
19
+ source: Source.ParentNode,
20
20
  };
21
21
  }
22
22
 
@@ -1,4 +1,4 @@
1
- import { MOVIE, VIDEOS } from '../constants.ts';
1
+ import { MOVIE, Source, VIDEOS } from '../constants.ts';
2
2
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
3
3
  import { type RawMovie, type RawMovieVideos, type RawMovieWithAppendToResponse } from '../types.ts';
4
4
 
@@ -16,7 +16,7 @@ export const resolveMovieVideos = buildObjResolver<
16
16
  return {
17
17
  data: obj.videos?.results,
18
18
  headers: obj.__headers,
19
- source: 'parentNode',
19
+ source: Source.ParentNode,
20
20
  };
21
21
  }
22
22
 
@@ -1,4 +1,4 @@
1
- import { MOVIE, RAW_WATCH_PROVIDERS } from '../constants.ts';
1
+ import { MOVIE, RAW_WATCH_PROVIDERS, Source } from '../constants.ts';
2
2
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
3
3
  import { type RawMovie, type RawMovieWatchProviders, type RawMovieWithAppendToResponse } from '../types.ts';
4
4
 
@@ -16,7 +16,7 @@ export const resolveMovieWatchProviders = buildObjResolver<
16
16
  return {
17
17
  data: obj['watch/providers']?.results,
18
18
  headers: obj.__headers,
19
- source: 'parentNode',
19
+ source: Source.ParentNode,
20
20
  };
21
21
  }
22
22
 
@@ -1,6 +1,6 @@
1
1
  import { type QueryNetworkArgs } from '@tmdb-graphql-api/schema/types';
2
2
  import { isUndefined, snakeCase } from 'lodash-es';
3
- import { NETWORK } from '../constants.ts';
3
+ import { NETWORK, Source } from '../constants.ts';
4
4
  import { buildObjArgsResolver } from '../helpers/buildObjArgsResolver.ts';
5
5
  import { type RawNetwork } from '../types.ts';
6
6
 
@@ -17,7 +17,7 @@ export const resolveNetwork = buildObjArgsResolver<
17
17
  if (obj && !isUndefined(obj[typedFieldName])) {
18
18
  return {
19
19
  data: obj[typedFieldName],
20
- source: 'parentNode',
20
+ source: Source.ParentNode,
21
21
  };
22
22
  }
23
23
 
@@ -7,6 +7,7 @@ import {
7
7
  MOVIE_CREDITS,
8
8
  PERSON,
9
9
  PROFILES,
10
+ Source,
10
11
  TRANSLATIONS,
11
12
  TV_CREDITS,
12
13
  } from '../constants.ts';
@@ -36,7 +37,7 @@ export const resolvePerson = buildObjArgsResolver<
36
37
  if (obj && !isUndefined(obj[typedFieldName])) {
37
38
  return {
38
39
  data: obj[typedFieldName],
39
- source: 'parentNode',
40
+ source: Source.ParentNode,
40
41
  };
41
42
  }
42
43
 
@@ -1,6 +1,6 @@
1
1
  import { snakeCase } from 'lodash-es';
2
2
  import type { Except } from 'type-fest';
3
- import { COMBINED_CREDITS, PERSON } from '../constants.ts';
3
+ import { COMBINED_CREDITS, PERSON, Source } from '../constants.ts';
4
4
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
5
5
  import { type RawPerson, type RawPersonCombinedCredits, type RawPersonWithAppendToResponse } from '../types.ts';
6
6
 
@@ -19,7 +19,7 @@ export const resolvePersonCombinedCredits = buildObjResolver<
19
19
  return {
20
20
  data: obj.combined_credits,
21
21
  headers: obj.__headers,
22
- source: 'parentNode',
22
+ source: Source.ParentNode,
23
23
  };
24
24
  }
25
25
 
@@ -1,6 +1,6 @@
1
1
  import { snakeCase } from 'lodash-es';
2
2
  import type { Except } from 'type-fest';
3
- import { EXTERNAL_IDS, PERSON } from '../constants.ts';
3
+ import { EXTERNAL_IDS, PERSON, Source } from '../constants.ts';
4
4
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
5
5
  import { type RawPerson, type RawPersonExternalIds, type RawPersonWithAppendToResponse } from '../types.ts';
6
6
 
@@ -19,7 +19,7 @@ export const resolvePersonExternalIds = buildObjResolver<
19
19
  return {
20
20
  data: obj.external_ids,
21
21
  headers: obj.__headers,
22
- source: 'parentNode',
22
+ source: Source.ParentNode,
23
23
  };
24
24
  }
25
25
 
@@ -1,6 +1,6 @@
1
1
  import { snakeCase } from 'lodash-es';
2
2
  import type { Except } from 'type-fest';
3
- import { MOVIE_CREDITS, PERSON } from '../constants.ts';
3
+ import { MOVIE_CREDITS, PERSON, Source } from '../constants.ts';
4
4
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
5
5
  import { type RawPerson, type RawPersonMovieCredits, type RawPersonWithAppendToResponse } from '../types.ts';
6
6
 
@@ -19,7 +19,7 @@ export const resolvePersonMovieCredits = buildObjResolver<
19
19
  return {
20
20
  data: obj.movie_credits,
21
21
  headers: obj.__headers,
22
- source: 'parentNode',
22
+ source: Source.ParentNode,
23
23
  };
24
24
  }
25
25
 
@@ -1,4 +1,4 @@
1
- import { IMAGES, PERSON } from '../constants.ts';
1
+ import { IMAGES, PERSON, Source } from '../constants.ts';
2
2
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
3
3
  import { type RawPerson, type RawPersonProfiles, type RawPersonWithAppendToResponse } from '../types.ts';
4
4
 
@@ -16,7 +16,7 @@ export const resolvePersonProfiles = buildObjResolver<
16
16
  return {
17
17
  data: obj.images?.profiles,
18
18
  headers: obj.__headers,
19
- source: 'parentNode',
19
+ source: Source.ParentNode,
20
20
  };
21
21
  }
22
22
 
@@ -1,4 +1,4 @@
1
- import { PERSON, TRANSLATIONS } from '../constants.ts';
1
+ import { PERSON, Source, TRANSLATIONS } from '../constants.ts';
2
2
  import { buildObjResolver } from '../helpers/buildObjResolver.ts';
3
3
  import { type RawPerson, type RawPersonTranslations, type RawPersonWithAppendToResponse } from '../types.ts';
4
4
 
@@ -16,7 +16,7 @@ export const resolvePersonTranslations = buildObjResolver<
16
16
  return {
17
17
  data: obj.translations?.translations,
18
18
  headers: obj.__headers,
19
- source: 'parentNode',
19
+ source: Source.ParentNode,
20
20
  };
21
21
  }
22
22