Skip to content

Commit 31a3c51

Browse files
committed
buildClientSchema: build enum type value maps lazily
1 parent ef042cf commit 31a3c51

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/utilities/buildClientSchema.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,15 @@ export function buildClientSchema(
284284
return new GraphQLEnumType({
285285
name: enumIntrospection.name,
286286
description: enumIntrospection.description,
287-
values: keyValMap(
288-
enumIntrospection.enumValues,
289-
(valueIntrospection) => valueIntrospection.name,
290-
(valueIntrospection) => ({
291-
description: valueIntrospection.description,
292-
deprecationReason: valueIntrospection.deprecationReason,
293-
}),
294-
),
287+
values: () =>
288+
keyValMap(
289+
enumIntrospection.enumValues,
290+
(valueIntrospection) => valueIntrospection.name,
291+
(valueIntrospection) => ({
292+
description: valueIntrospection.description,
293+
deprecationReason: valueIntrospection.deprecationReason,
294+
}),
295+
),
295296
});
296297
}
297298

0 commit comments

Comments
 (0)