dotansimha / dotansimha/graphql-code-generator

`persistedDocuments` type defs generated is missing `__meta__` prop

Open
#10,121 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

### Which packages are impacted by your issue?

@graphql-codegen/client-preset

### Describe the bug

When running client preset and `persistedDocuments` the types output are not properly reflecting the `__meta__` prop that is added by codegen:

### Your Example Website or App

https://codesandbox.io/p/devbox/vigilant-christian-g36xzx-g36xzx?file=/src/index.ts:18,25

### Steps to Reproduce the Bug or Issue

1. Open codesandbox
2. npm codegen
3. verify it works: npm start (should get a fetch error but it prints an object with __meta__ prop before that)
4. open src/index.ts
5. editor shows a TS error

### Expected behavior

No TS error, the `__meta__` prop should be generated by codegen ts defs

### Screenshots or Videos

Screenshot 2024-08-22 at 4 37 11 PM

### Platform

- OS: [e.g. macOS, Windows, Linux]

Versions are pinned in the repro repo:

```
"dependencies": {
"graphql": "16.9.0"
},
"devDependencies": {
"@graphql-codegen/cli": "5.0.2",
"@graphql-codegen/client-preset": "4.3.3",
"@types/node": "20.16.1",
"prettier": "3.3.3",
"tsx": "4.17.0",
"typescript": "5.5.4"
}
```

### Codegen Config File

see repo

### Additional context

see repo

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.