@tmdb-graphql-api/resolvers 0.1.2-unstable.15 → 0.1.2-unstable.18
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/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/production.analysis.txt +261 -261
- package/dist/types/cjs/helpers/buildObjArgsResolver.d.cts +1 -1
- package/dist/types/cjs/helpers/buildObjArgsResolver.d.cts.map +1 -1
- package/dist/types/esm/helpers/buildObjArgsResolver.d.ts +1 -1
- package/dist/types/esm/helpers/buildObjArgsResolver.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/helpers/buildObjArgsResolver.ts +6 -3
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.
|
|
4
|
+
"version": "0.1.2-unstable.18",
|
|
5
5
|
"author": "Dylan Aubrey",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/badbatch/themoviedb-graphql-api",
|
|
@@ -32,7 +32,7 @@
|
|
|
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.
|
|
35
|
+
"@graphql-box/connection-resolver": "^5.4.17",
|
|
36
36
|
"@graphql-box/core": "^5.4.6",
|
|
37
37
|
"cacheability": "^4.0.27",
|
|
38
38
|
"getta": "^1.0.15",
|
|
@@ -40,7 +40,7 @@
|
|
|
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.
|
|
43
|
+
"@tmdb-graphql-api/rest-client": "0.0.11-unstable.9",
|
|
44
44
|
"@tmdb-graphql-api/schema": "0.1.1-unstable.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GraphQLError, type GraphQLResolveInfo } from 'graphql';
|
|
2
|
+
import { isUndefined, snakeCase } from 'lodash-es';
|
|
2
3
|
import crypto from 'node:crypto';
|
|
3
|
-
import { ResolverType, Source } from '../constants.ts';
|
|
4
|
+
import { ResolverType, type Source } from '../constants.ts';
|
|
4
5
|
import { type Context } from '../types.ts';
|
|
5
6
|
|
|
6
7
|
export const buildObjArgsResolver =
|
|
@@ -37,13 +38,15 @@ export const buildObjArgsResolver =
|
|
|
37
38
|
return id ? `${enrichedMessage} ${String(id)}` : enrichedMessage;
|
|
38
39
|
};
|
|
39
40
|
|
|
40
|
-
const
|
|
41
|
-
const loggingEnabled =
|
|
41
|
+
const typedFieldName = snakeCase(fieldName) as keyof Obj;
|
|
42
|
+
const loggingEnabled = !(obj && !isUndefined(obj[typedFieldName]));
|
|
42
43
|
|
|
43
44
|
if (loggingEnabled) {
|
|
44
45
|
childLogger.info(enrichLogMessage('Resolving'), { logEntryName: 'RESOLVER_START' });
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
const { data, errors, headers } = await callback(obj, args, newCtx, info);
|
|
49
|
+
|
|
47
50
|
if (errors?.length) {
|
|
48
51
|
const message = enrichLogMessage('Failed to resolve');
|
|
49
52
|
|