Giter VIP home page Giter VIP logo

Comments (3)

TriPSs avatar TriPSs commented on June 27, 2024 1

I have to say that I personally do not use assembles, looking at the code I have the feeling that the docs are either missing some information on how to make this work (As I have the feeling the AssemblerQueryService should be used somewhere).

I would need to take a deeper look into how these parts work before I could help you with the issue.

from nestjs-query.

smolinari avatar smolinari commented on June 27, 2024 1

Yeah. In my POC with assemblers, I got the automation along with the assembler working by extending the AssemblerQueryService as @TriPSs suggests.

@Assembler(UserDTO, UserEntity)
export class UserAssembler extends ClassTransformerAssembler<UserDTO, UserEntity> {}

@Injectable()
@QueryService(UserDTO)
export class UserService extends AssemblerQueryService<UserDTO, UserEntity> {
  constructor (
    readonly assembler: UserAssembler,
    @InjectQueryService(UserEntity) private readonly userService: QueryService<UserEntity>
  ) {
    super(assembler, userService)
  }

And of course, I entered my UserAssember in the module's assemblers property .

Seems the AssemblerQueryService does the work, when you give it the assembler and the pertinent service. Don't ask me how I found that. Haha... I can't remember.

Edit: Yeah, I probably just took a look at this and said to myself, why not just extend it?
https://github.com/TriPSs/nestjs-query/blob/master/packages/core/src/services/assembler-query.service.ts

Scott

from nestjs-query.

TriPSs avatar TriPSs commented on June 27, 2024

Closing, if still an issue please reopen.

from nestjs-query.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.