Skip to content

Commit ebd835d

Browse files
committed
refactor
1 parent aad9208 commit ebd835d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/definitions/input.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export function buildInputObjectDefinition(
2828
}
2929

3030
const typeNameWithoutInput = node.name.value.replace("Input", "");
31-
const correspondingType = schema.getType(typeNameWithoutInput);
32-
if (correspondingType) {
31+
const matchingType = schema.getType(typeNameWithoutInput);
32+
if (matchingType) {
3333
return "";
3434
}
3535

src/definitions/object.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export function buildObjectTypeDefinition(
3535
}
3636

3737
const typeNameWithInput = `${node.name.value}Input`;
38-
const correspondingInput = schema.getType(typeNameWithInput);
39-
const inputOutputAnnotation = correspondingInput
38+
const matchingInput = schema.getType(typeNameWithInput);
39+
const typeConsolidationAnnotation = matchingInput
4040
? "@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT, GraphQLValidObjectLocations.Locations.OBJECT])\n"
4141
: "";
4242

@@ -63,7 +63,7 @@ ${getDataClassMembers({ node, schema, config, completableFuture: true })}
6363
}`;
6464
}
6565

66-
return `${annotations}${inputOutputAnnotation}data class ${name}(
66+
return `${annotations}${typeConsolidationAnnotation}data class ${name}(
6767
${getDataClassMembers({ node, schema, config })}
6868
)${interfaceInheritance}`;
6969
}

0 commit comments

Comments
 (0)