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

documentVariableSuffix doesn't work with client preset #10229

Open
InsidersByte opened this issue Jan 4, 2025 · 0 comments
Open

documentVariableSuffix doesn't work with client preset #10229

InsidersByte opened this issue Jan 4, 2025 · 0 comments

Comments

@InsidersByte
Copy link

Which packages are impacted by your issue?

@graphql-codegen/client-preset

Describe the bug

documentVariableSuffix is not respected in the graphql.ts, but it is in the gql.ts.

I believe this is because documentVariableSuffix is not part of the forwarded config for graphql.ts.

Your Example Website or App

https://codesandbox.io/p/devbox/priceless-water-5p9m3h?workspaceId=ws_Gkwk4Jh3EcjEfvkuEJQn9z

Steps to Reproduce the Bug or Issue

  1. generate the files with the configuration in the codesandbox
  2. there is no suffix in gql/gql.ts, but there is Document in the gql/graphql.ts
  3. remove documentVariableSuffix
  4. both gql/gql.ts and gql/graphql.ts has the Document suffix

Expected behavior

For both gql/gql.ts and gql/graphql.ts to respect the documentVariableSuffix.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • graphql version: ^16.2.0
  • @graphql-codegen/* version(s): ^5.0.3

Codegen Config File

import { CodegenConfig } from "@graphql-codegen/cli";

const config: CodegenConfig = {
  schema: "schema.graphql",
  documents: "document.graphql",
  generates: {
    "gql/": {
      preset: "client",
      config: {
        documentVariableSuffix: "",
      },
    },
  },
};

export default config;

Additional context

No response

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

No branches or pull requests

1 participant