English 中文(简体)
Graphql-upload consumer gives this error: /node_modules/@types/graphql-upload/index") has no call signatures
原标题:

I have a nestjs apollo graphql gateway where in my app.module i have:

import graphqlUploadExpress from  graphql-upload ;
import {
  Module,
  BadRequestException,
  HttpStatus,
  HttpException,
  UnauthorizedException,
  MiddlewareConsumer,
} from  @nestjs/common ;

and

export class AppModule {
  configure(consumer: MiddlewareConsumer) {
    consumer.apply(graphqlUploadExpress()).forRoutes( graphql );
  }
}

I am getting a lint error :

This expression is not callable.
  Type  typeof import("/Applications/flash/flash-gateway/node_modules/@types/graphql-upload/index")  has no call signatures

I am using

 "graphql-upload": "~16.0.2",
"@types/graphql-upload": "~16.0.0",

Now I understand that some changes in the newer version of graphql-upload has resulted in some breaking changes and some even suggested I should be importing like this:

import graphqlUploadExpress from  graphql-upload/graphqlUploadExpress.js 

but none of these suggestions works with v16. How do I call the middleware consumer for graphql-upload in v16?

问题回答

暂无回答




相关问题
Save JSON response from axios Post to variable

I am doing an axios post call to graphQL URL. Can I save the response to a variable to use later. My code: const myDta = axios.post( "https://test.test.com/graphql", {...

Can t set cookie in response NestJs

I Have a nestjs graphQL auth microservice and trying to set a http only cookie containing the token, and for some reason setting the cookie doesn t work, i get this error: { "errors": [ ...

How can I make appsync type valid in Apollo Federation

I am trying to use Apollo Federation to connect subgraph from AWS Appsync. When I start federation I got this error: UNKNOWN: Unknown type AWSDateTime. It seems Federation doesn t recognise AWS Scalar ...

热门标签