Skip to content

Usage along with globally exported types #28

Closed
@RicardoTrindade

Description

@RicardoTrindade

Have a question regarding the usage along with the add plugin https://graphql-code-generator.com/docs/plugins/add

We're using this plugin to have our types globally available, so our generated types file looks like this

declare namespace Api {
  type Payment  = { 
    id: Scalars['Int'];
  }
...
}

When using the generated types we don't need to import them and call Api.Paymentdirectly.

Now when using it with the mock data generator the mocks are generated as follows

export const mockPayment = (overrides?: Partial<Payment>): Payment => {
}

which is not working as the type should have the Api. prefix to compile successfully.
Is this something you are considering to support or are accepting a PR any time soon ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions