Skip to content

enum on directive with enumPrefix to false still adds prefix #10285

@veeramarni

Description

@veeramarni

Which packages are impacted by your issue?

typescript

Describe the bug

Enums on directives: These are generated doesn’t take the enumPrefix configuration into account.

Your Example Website or App

Steps to Reproduce the Bug or Issue

Here is the example

directive @cacheControl(maxAge: Int, scope: CacheControlScope) on FIELD_DEFINITION | OBJECT | INTERFACE
enum CacheControlScope {
    PUBLIC
    PRIVATE
}

generated code

export enum CacheControlScope {
  Private = 'PRIVATE',
  Public = 'PUBLIC'
}
export type ICacheControlDirectiveArgs = {
  maxAge?: Maybe<Scalars['Int']['input']>;
  scope?: Maybe<ICacheControlScope>;
};

Expected behavior

expected below

export type ICacheControlDirectiveArgs = {
  maxAge?: Maybe<Scalars['Int']['input']>;
  scope?: Maybe<CacheControlScope>;
};

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • NodeJS: [e.g. 18.5.0]
  • graphql version: [e.g. 16.3.0]
        "@graphql-codegen/add": "^5.0.3",
        "@graphql-codegen/cli": "^5.0.4",
        "@graphql-codegen/fragment-matcher": "^5.1.0",
        "@graphql-codegen/typescript": "^4.1.3",
        "@graphql-codegen/typescript-operations": "^4.4.1",
        "@graphql-codegen/typescript-resolvers": "^4.4.2"

Codegen Config File

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions