Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
eddeee888 committed Nov 11, 2024
1 parent 3d26ef1 commit b8e566b
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 522 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ export const handleGraphQLEnumType: GraphQLTypeHandler<
const forcedGenerationWarning = (() => {
if (!matchedPatternToGenerate && mapperDetails) {
logger.debug(
`Enum resolver generation was NOT skipped because there is a associated mapper: "${normalizedResolverName.withModule}". "Pattern: ${resolverGeneration.enum}". Mapper: ${mapperDetails.typeMapperName}`
`Enum resolver generation was NOT skipped because there is a associated mapper: "${normalizedResolverName.withModule}". "Pattern: ${resolverGeneration.enum}". Mapper: ${mapperDetails.mapper.name}`
);
return `/*
* Note: This enum file is generated because "${mapperDetails.typeMapperName}" is declared. This is to ensure runtime safety.
* Note: This enum file is generated because "${mapperDetails.mapper.name}" is declared. This is to ensure runtime safety.
* If you want to skip this file generation, remove the mapper or update the pattern in the \`resolverGeneration.object\` config.
*/\n`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ export const handleGraphQLObjectType: GraphQLTypeHandler<
const forcedGenerationWarning = (() => {
if (!matchedPatternToGenerate && mapperDetails) {
logger.debug(
`Object resolver generation was NOT skipped because there is a associated mapper: "${normalizedResolverName.withModule}". "Pattern: ${resolverGeneration.object}". Mapper: ${mapperDetails.typeMapperName}`
`Object resolver generation was NOT skipped because there is a associated mapper: "${normalizedResolverName.withModule}". "Pattern: ${resolverGeneration.object}". Mapper: ${mapperDetails.mapper.name}`
);
return `/*
* Note: This object type is generated because "${mapperDetails.typeMapperName}" is declared. This is to ensure runtime safety.
* Note: This object type is generated because "${mapperDetails.mapper.name}" is declared. This is to ensure runtime safety.
*
* When a mapper is used, it is possible to hit runtime errors in some scenarios:
* - given a field name, the schema type's field type does not match mapper's field type
Expand Down
Loading

0 comments on commit b8e566b

Please sign in to comment.