Skip to content

Commit 4fc325f

Browse files
committed
Fix
1 parent 9f9c6e6 commit 4fc325f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/social-pots-grab.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-tools/utils': patch
3+
---
4+
5+
Do not map builtin scalars

packages/utils/src/mapSchema.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
GraphQLNonNull,
1515
GraphQLObjectType,
1616
GraphQLObjectTypeConfig,
17+
GraphQLScalarType,
1718
GraphQLSchema,
1819
GraphQLType,
1920
InputValueDefinitionNode,
@@ -28,6 +29,7 @@ import {
2829
isScalarType,
2930
isUnionType,
3031
Kind,
32+
specifiedScalarTypes,
3133
} from 'graphql';
3234
import { getObjectTypeFromTypeMap } from './getObjectTypeFromTypeMap.js';
3335
import {
@@ -109,7 +111,10 @@ function mapTypes(
109111
if (!typeName.startsWith('__')) {
110112
const originalType = originalTypeMap[typeName];
111113

112-
if (originalType == null || !testFn(originalType)) {
114+
if (
115+
originalType == null ||
116+
(!testFn(originalType) && !specifiedScalarTypes.includes(originalType as GraphQLScalarType))
117+
) {
113118
newTypeMap[typeName] = originalType;
114119
continue;
115120
}

0 commit comments

Comments
 (0)