Skip to content

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

Open
@Vittorio1970

Description

@Vittorio1970

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?

.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions