apollo-resolvers
apollo-resolvers copied to clipboard
Typescript - TypeError: Cannot read property 'createResolver' of undefined
The following error is occurring when trying to use apollo-resolvers with typescript, I noticed that several people were having the same problem and I decided to open the issue, more details below.
Error
resolvers
userResolvers
package.json
"dependencies": {
"@sentry/node": "4.4.2",
"apollo-errors": "1.9.0",
"apollo-resolvers": "1.4.1",
"apollo-server-micro": "2.3.1",
"bcryptjs": "2.4.3",
"bluebird": "3.5.3",
"ccxt": "1.18.36",
"date-fns": "1.30.1",
"dotenv": "6.2.0",
"graphql": "14.0.2",
"i18nh": "0.0.4",
"idx": "2.5.2",
"jsonwebtoken": "8.4.0",
"micro": "9.3.3",
"micro-compose": "0.0.3",
"micro-cors": "0.1.1",
"mongoose": "5.3.16",
"ramda": "0.26.1",
"ts-node": "7.0.1",
"validator": "10.9.0"
},
"devDependencies": {
"@types/bcryptjs": "2.4.2",
"@types/bluebird": "3.5.25",
"@types/dotenv": "6.1.0",
"@types/graphql": "14.0.3",
"@types/jsonwebtoken": "8.3.0",
"@types/micro": "7.3.3",
"@types/micro-cors": "0.1.0",
"@types/mongoose": "5.3.5",
"@types/ramda": "0.25.43",
"@types/validator": "9.4.4",
"husky": "1.2.1",
"lint-staged": "8.1.0",
"nodemon": "1.18.8",
"prettier": "1.15.3",
"tslint": "5.11.0",
"tslint-config-prettier": "1.17.0",
"tslint-config-security": "1.13.0",
"typescript": "3.2.2"
},
have you tried adding this to your tsconfig.json compilerOptions?
"allowSyntheticDefaultImports": true,
@grsabreu same problem.
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": ["es6"],
"module": "commonjs",
// "noImplicitAny": true, // will raise several errors
"alwaysStrict": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"outDir": "dist",
"allowSyntheticDefaultImports": true,
},
"include": [ "**/*" ],
"exclude": [
"dist/*",
"node_modules",
"**/*.spec.ts"
]
}
Do you have any idea what this problem might be @thebigredgeek? I practically followed the details of the README.md but the only difference is that I am using typescript in the latest version
Huh no clue. it almost looks like something is overriding the value?
is this fixed ?
Let me take a look, apologies i've been busy bootstrapping my company!
https://github.com/boltsource/apollo-resolvers/pull/67