Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else if (isInputObjectType(schemaType)) {
result = {
baseType: `${this.convertName(schemaType.name)}Input`,
typeName: `${this.convertName(schemaType.name)}Input`,
isScalar: false,
isArray,
nullable: nullable,
};
} else if (isEnumType(schemaType)) {
result = { isArray, baseType: this.convertName(schemaType.name), typeName: this.convertName(schemaType.name), isScalar: true, nullable: nullable };
} else {
result = { isArray, baseType: 'Any', typeName: 'Any', isScalar: true, nullable: nullable };
}
if (result) {
result.typeName = wrapTypeWithModifiers(result.typeName, typeNode, this.config.listType);
}
return result;
}
}
} else if (isInputObjectType(schemaType)) {
result = {
baseType: `${this.convertName(schemaType.name)}Input`,
typeName: `${this.convertName(schemaType.name)}Input`,
isScalar: false,
isArray,
};
} else if (isEnumType(schemaType)) {
result = { isArray, baseType: this.convertName(schemaType.name), typeName: this.convertName(schemaType.name), isScalar: true };
} else {
result = { isArray, baseType: 'Object', typeName: 'Object', isScalar: true };
}
if (result) {
result.typeName = wrapTypeWithModifiers(result.typeName, typeNode, this.config.listType);
}
return result;
}
return (isInterface: boolean) => {
const baseType = getBaseTypeNode(node.type);
const typeToUse = this.getTypeToUse(baseType);
const wrappedType = wrapTypeWithModifiers(typeToUse, node.type, this.config.listType);
if (isInterface) {
return `default public DataFetcher<${wrappedType}> ${node.name.value}() { return null; }`;
} else {
return `public DataFetcher<${wrappedType}> ${node.name.value}();`;
}
};
}