Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!