Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

180
Visualizações
Resolver inheritance dont show arguments typegraphql

i have an issue whit the typegraphql, I try to do a BaseResolver that can have a base CRUD operations whit typeorm but when i compile the protect whit ts node i don't get the arguments of there resolvers query/mutation, instead the arguments show and then disappear after a couple of seconds of compile this is my code.

export function CreateBaseResolver<X extends ClassType, T extends ClassType>
(
    Suffix: string,
    ReturnEntity: T,
    BaseInput: X,
    Entity: any,
)
{
    @Resolver({ isAbstract: true })
    abstract class BaseResolver
    {
        @Mutation(() => [ReturnEntity], { name: `PostOne${Suffix}` })
        async PostOne(@Arg('Data', () => BaseInput) Data: any) 
        {
             //Make logic
        }

    }

    return BaseResolver;
}

this is the normal resolver

@InputType()
export class ProductInput
{
    @Field()
    Id_Product: number;
}


const ProductBaseResolver = CreateBaseResolver('Product', Product, ProductInput, Product);

@Resolver(Product)
export class ProductResolver extends ProductBaseResolver
{

}

i found this in the issues of github https://github.com/MichalLytek/type-graphql/issues/55

it seems like we need to compile the typescript whit babel, but i use ts node in my case, try to do it whit babel but get the same error and i don't have parameters in my resolver, if anyone has this issue please i really appreciate an example of how to do it whit babel i will give mi pakaje.json info bellow

  "scripts": {
    "watch": "tsc -w",
    "dev": "nodemon dist/index.js",
    "start": "node dist/index.js",
    "prestart": "ts-node src/index.ts"
  },
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda