Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with decorators of "type-graphql" #62

Open
mduvernon opened this issue Mar 25, 2023 · 4 comments
Open

Does not work with decorators of "type-graphql" #62

mduvernon opened this issue Mar 25, 2023 · 4 comments
Labels
question Further information is requested

Comments

@mduvernon
Copy link

mduvernon commented Mar 25, 2023

Does not work with decorators of "type-graphql"
Even if aplying

@tannerntannern tannerntannern added the question Further information is requested label Mar 25, 2023
@tannerntannern
Copy link
Owner

You're going to have to be more specific. A minimal reproducible example would be helpful.

@mduvernon
Copy link
Author

Let's say we have the following code snipet from "type-graphql"

`
import { Field, Int, ObjectType } from 'type-graphql';
import { Mixin, decorate } from 'ts-mixer';

@ObjectType()
class Foo {
@decorate(Field())
fooTitle: string;

@decorate(Field(type => [Rate]))
fooRatings: Rate[];

@decorate(Field({ nullable: true }))
fooAverageRating?: number;
}

......

@ObjectType()
class Bar {
@decorate(Field())
barTitle: string;

@decorate(Field(type => [Rate]))
barRatings: Rate[];

@decorate(Field({ nullable: true }))
barAverageRating?: number;
}

@ObjectType()
class MyClass extends Mixin(Foo, Bar) {}
`

This code "MyClass" does not seem to apply the parent decorator "Field" properties

@tannerntannern
Copy link
Owner

tannerntannern commented Mar 29, 2023

@decorate should be used for class decorators as well as field decorators. If you make that change, does it work for you?

@mduvernon
Copy link
Author

Does not work either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants