glideapps / glideapps/quicktype

Keep separate GraphQL types as separate classes

Open
#1,072 4 comments 2 reactions 0 assignees View on GitHub
GraphQL
Dominant language
TypeScript
Stars
13.9k
Forks
1.2k
Avg merge
8h 53m
Merged PRs (30d)
369

Description

Howdy!

I'm trying to generate Typescript types from an introspected GraphQL schema.

## What I did

I want to avoid combining similar classes, so I'm adding `--no-combine-classes`. My full command:

```sh
quicktype --src-lang graphql --lang typescript --graphql-schema schema.json --just-types --no-combine-classes query.json
```

## What I expected
The following combined class called `GridConfigClass` to be removed

```ts
export interface Grid {
config: GridConfigClass | null;
props: GridConfigClass | null;
}

export interface GridConfigClass {
items: Array;
}
```

and replaced with separate interfaces

```ts
export interface Grid {
config: GridConfig | null;
props: GridProps | null;
}

export interface GridConfig {
items: Array;
}

export interface GridProps {
items: Array;
}
```

## What happened
The output didn't change, and the combined `GridConfigClass` remains.

---

Thanks for the awesome tool.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.