graphql-compose / graphql-compose/graphql-compose
Error when using GraphQLUpload from graphql-upload
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 75
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 3
Description
Hello @nodkz, see if is possible help us.
The GraphQLUpload const type is [GraphQLScalarType](https://github.com/graphql/graphql-js/blob/29b811fca5f726c9a3aa1d979c70ecbced8b4ec8/src/type/definition.ts#L583) from the graphql package, but the class does not have the **type** attribute. However the [ObjectTypeComposer.ts](https://github.com/graphql-compose/graphql-compose/blob/5499c67e59c9891e485a11d8e46de0771804a79c/src/ObjectTypeComposer.ts#L162) class has the **type** attribute. So during the build process we are getting this error:
```
Type 'GraphQLScalarType' is not assignable to type 'ObjectTypeComposerArgumentConfig | ObjectTypeComposerArgumentConfigDefinition'.
Property 'type' is missing in type 'GraphQLScalarType' but required in type 'ObjectTypeComposerArgumentConfigAsObjectDefinition'.ts(2322)
ObjectTypeComposer.d.ts(58, 5): 'type' is declared here.
```
It's my package.json
```json
{
"name": "nestjs-graphql-best-practice",
"version": "1.0.1",
"description": "Nestjs GraphQL Best Practice",
"author": "Chnirt",
"license": "MIT",
"engines": {
"node": ">=12 <16"
},
"keywords": [
"nestjs",
"bootstrap",
"express",
"apollo-graphql",
"mongoose",
"typegoose",
"graphql-compose-mongoose"
],
"scripts": {
"add": "cd scripts && node create-resource.js && cd ..",
"cs": "cd scripts && node create-service.js && cd ..",
"cr": "cd scripts && node create-repository.js && cd ..",
"build": "tsc -p tsconfig.build.json",
"format": "prettier --write \"src/**/*.ts\"",
"start": "ts-node -r tsconfig-paths/register src/main.ts",
"start:dev": "nodemon",
"start:debug": "nodemon --config nodemon-debug.json",
"start:prod": "NODE_ENV=production node -r ./tsconfig-paths-bootstrap.js dist/main.js",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint:fix": "tslint --fix -p tsconfig.json -c tslint.json",
"test": "NODE_ENV=testing jest -w 1 --config ./jest.config.json --forceExit",
"test:watch": "NODE_ENV=testing jest -w 1 --watch --forceExit",
"test:cov": "NODE_ENV=testing jest -w 1 --config ./jest.config.json --coverage --forceExit",
"test:debug": "NODE_ENV=testing node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest -w 1 --runInBand --forceExit",
"test:e2e": "NODE_ENV=testing jest -w 1 --config ./test/jest-e2e.json --forceExit",
"webpack": "webpack --config webpack.config.js",
"start:hmr": "node dist/main.js",
"gen": "ts-node src/generator/generate-typings.ts",
"db:seed": "ts-node src/dbseed.ts",
"doc": "npx compodoc --port 11045 -p tsconfig.json -s",
"doc:serve": "yarn doc && npx compodoc -s",
"heroku-postbuild": "yarn --only=dev --no-shrinkwrap && yarn build && yarn gen",
"now-build": "yarn --only=dev --no-shrinkwrap && yarn build && yarn gen",
"dump": "ts-node src/dump",
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls"
},
"dependencies": {
"@apollo/federation": "^0.10.2",
"@apollo/gateway": "^0.10.8",
"@firebase/app-compat": "^0.1.10",
"@google-cloud/translate": "^6.3.0",
"@nestjs/bull": "^0.4.2",
"@nestjs/common": "^8.2.3",
"@nestjs/core": "^8.2.3",
"@nestjs/event-emitter": "^1.0.0",
"@nestjs/graphql": "^8.0.2",
"@nestjs/microservices": "^8.0.7",
"@nestjs/platform-express": "^8.2.3",
"@nestjs/schedule": "^1.0.2",
"@typegoose/typegoose": "^8.2.0",
"acorn": "^6.4.2",
"apollo-server": "^2.9.9",
"apollo-server-cache-memcached": "^0.6.3",
"apollo-server-express": "^2.9.7",
"apollo-server-plugin-response-cache": "^0.3.5",
"assert": "^2.0.0",
"axios": "^0.19.0",
"bcrypt": "^3.0.6",
"bull": "^3.29.3",
"cache-manager": "^2.10.0",
"chai": "^4.2.0",
"chalk": "^4.1.0",
"change-case": "^4.1.2",
"class-transformer": "^0.2.3",
"class-validator": "^0.13.1",
"cloudinary": "1.16.0",
"compression": "^1.7.4",
"cron": "^1.7.2",
"csurf": "^1.10.0",
"dateformat": "^3.0.3",
"dotenv": "^8.2.0",
"email-validator": "^2.0.4",
"express-rate-limit": "^5.0.0",
"firebase-admin": "^10.0.0",
"fs": "0.0.2",
"graphql": "^14.5.8",
"graphql-compose": "^9.0.4",
"graphql-compose-mongoose": "^9.7.0",
"graphql-depth-limit": "^1.1.0",
"graphql-query-complexity": "^0.9.0",
"graphql-rate-limit": "^2.0.1",
"graphql-redis-subscriptions": "^2.4.0",
"graphql-tools": "^4.0.5",
"graphql-type-json": "^0.3.0",
"graphql-upload": "^12.0.0",
"graphql-voyager": "^1.0.0-rc.28",
"handlebars": "^4.4.5",
"helmet": "^3.21.2",
"ioredis": "^4.14.1",
"jest-config": "^24.9.0",
"jsonwebtoken": "^8.5.1",
"libphonenumber-js": "^1.9.38",
"merge-graphql-schemas": "^1.7.0",
"moment": "^2.29.1",
"mongodb": "^3.3.3",
"mongoose": "^5.13.8",
"morgan": "^1.9.1",
"multer": "^1.4.2",
"nest-winston": "^1.6.0",
"nestjs-i18n": "^8.1.6",
"nodemailer": "^6.3.1",
"nodemailer-express-handlebars": "^3.1.0",
"passport": "^0.4.0",
"passport-facebook": "^3.0.0",
"passport-facebook-token": "^3.3.0",
"passport-google-oauth": "^2.0.0",
"passport-google-plus-token": "^2.1.0",
"passport-google-token": "^0.1.2",
"pluralize": "^8.0.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"redis": "^3.1.2",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.0",
"rxjs": "7.4.0",
"stripe": "^8.132.0",
"tsconfig-paths": "^3.9.0",
"uuid": "^3.3.3",
"webpack-bundle-analyzer": "^3.6.0",
"winston": "^3.2.1"
},
"devDependencies": {
"@compodoc/compodoc": "^1.1.11",
"@nestjs/testing": "^8.2.3",
"@types/bull": "^3.15.6",
"@types/express": "^4.17.1",
"@types/graphql-upload": "^8.0.7",
"@types/jest": "^24.0.19",
"@types/jsonwebtoken": "^8.5.5",
"@types/node": "^12.11.1",
"@types/nodemailer": "^6.2.1",
"@types/pluralize": "0.0.29",
"@types/stripe": "^7.10.7",
"@types/supertest": "^2.0.8",
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"codecov": "^3.6.1",
"concurrently": "^5.0.0",
"coveralls": "^3.0.7",
"eslint": "^5.16.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"fs-extra": "^10.0.0",
"husky": "^3.0.9",
"jest": "^24.9.0",
"lint-staged": "^9.4.2",
"ncp": "^2.0.0",
"nodemon": "^1.19.4",
"prettier": "^1.19.1",
"progress-bar-webpack-plugin": "^1.12.1",
"supertest": "^4.0.2",
"ts-jest": "^24.1.0",
"ts-loader": "^6.2.0",
"ts-morph": "12.2.0",
"ts-node": "^8.4.1",
"tslint": "^5.20.0",
"tslint-clean-code": "^0.2.10",
"tslint-config-prettier": "^1.18.0",
"typescript": "4.3.5",
"wait-on": "^3.3.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.9",
"webpack-loader-helper": "^1.0.0",
"webpack-node-externals": "^1.7.2",
"yarn": "^1.19.1"
},
"lint-staged": {
"*.ts": [
"yarn format",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.