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

Generating all types #453

Closed
banool opened this issue Jul 31, 2023 · 1 comment
Closed

Generating all types #453

banool opened this issue Jul 31, 2023 · 1 comment

Comments

@banool
Copy link

banool commented Jul 31, 2023

Using graphql-codgen in Typescript I'm able to generate code from a schema without providing any queries or mutations.

For example:

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

const config: CodegenConfig = {
  overwrite: true,
  schema: "src/canvas/generated/schema.graphql",
  generates: {
    "src/canvas/generated/types.ts": {
      config: {
        emitLegacyCommonJSImports: false,
        namingConvention: "keep",
        avoidOptionals: true,
      },
      plugins: ["typescript"],
    },
  },
};

export default config;

This generates a file called types.rs that has just types, no queries or operations or mutations or anything.

Is there a way to do this with this library? It seems like there isn't via the CLI but I wonder if this is possible with the underlying libraries.

Thanks!

@banool
Copy link
Author

banool commented Jul 31, 2023

I realise this is a duplicate of #443, closing.

@banool banool closed this as completed Jul 31, 2023
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