https://github.com/jonaskello/graphql-codegen-issue2
https://github.com/jonaskello/graphql-codegen-issue2
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jonaskello/graphql-codegen-issue2
- Owner: jonaskello
- Created: 2019-04-01T14:51:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-02T14:02:22.000Z (about 7 years ago)
- Last Synced: 2024-10-06T02:21:23.552Z (over 1 year ago)
- Language: TypeScript
- Size: 92.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## How to test
Generate from joined schema:
```bash
$ yarn graphql
```
Generates this incomplete type for `FooBar` (`Zoo` is missing in the union):
```ts
// ... other code
export type FooBar = Foo | Bar;
// ... other code
```
Printing the joined schema gives the correct type of `FooBar` with `Zoo` included so it seems the joining works:
```bash
$ yarn print
```
```graphql
type Bar {
id: ID!
}
type Foo {
id: ID!
}
union FooBar = Foo | Bar | Zoo
type Query {
fooBar: [FooBar!]!
}
type Zoo {
id: ID!
}
```
Also using the `typescript` plugin programatically gives the correct result:
```bash
$ yarn prog
```
```ts
// ... other code
export type FooBar = Foo | Bar | Zoo;
// ... other code
```