I am currently in the process of converting my node.js app to TypeScript, and I have come across a number of index.js files with the following setup:
module.exports = {
query: require('./query'),
mutation: require('./mutation')
}
This is later imported like so:
const { query } = require './module';
I attempted to refactor it as follows:
import {query} from './query'
import {mutation} from './mutation'
export default {
query,
mutation
}
However, I encountered an issue where I couldn't access the query object using import {query} from './query';
How can I successfully convert this structure to TypeScript so that I don't have to import the entire module? Thank you for your help!