graphql-rust/graphql-client

Generating all types

banool opened this issue · 1 comments

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!

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