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

@Extensions decorator don't work on @Field included in @InputType #3328

Open
1 task done
Vittorio1970 opened this issue Oct 10, 2024 · 0 comments
Open
1 task done
Labels

Comments

@Vittorio1970
Copy link

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

@ObjectType()

export class SampleOutput {
  **@Extensions({ key: 'Value present in extensions member' })**
  @Field({
    nullable: true,
  })
  errorMessage: string;
}

Result

{
  name: "errorMessage",
  description: undefined,
  type: { ........ },
  args: [],
  resolve: (source, args, contextValue, info) => { ..... },
  subscribe: undefined,
  deprecationReason: undefined,
  extensions: {
    complexity: undefined,
    **key: "Value present in fieldconfig",**
  },
  astNode: undefined,
}

@inputType()

export class SampleInput {
  @Extensions({ key: 'Value not present in field config' })
  @Field({
    nullable: false,
    defaultValue: false,
  })
  forceCreation: boolean;
}

Result

{
  name: "forceCreation",
  description: undefined,
  type: { .... },
  defaultValue: false,
  deprecationReason: undefined,
  **extensions: {
  },**
  astNode: undefined,
}

Describe the solution you'd like

Same behavior for fields included in both InputType and ObjectType

Teachability, documentation, adoption, migration strategy

.

What is the motivation / use case for changing the behavior?

.

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

No branches or pull requests

1 participant