Skip to content

Commit 2fa9695

Browse files
committed
Add changeset
1 parent 2260c7a commit 2fa9695

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.changeset/big-scissors-hope.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
"@apollo/client-graphql-codegen": minor
3+
---
4+
5+
Introduce a new GraphQL Codegen plugin to generate the input object configuration needed to configure custom scalars for each field.
6+
7+
```ts
8+
// codegen.ts
9+
import type { CustomScalarsPluginConfig } from "@apollo/client-graphql-codegen/custom-scalars";
10+
11+
const config: CodegenConfig = {
12+
// ...
13+
generates: {
14+
"./path/to/custom-scalars.ts": {
15+
plugins: ["@apollo/client-graphql-codegen/custom-scalars"],
16+
config: {
17+
// ...
18+
} satisfies CustomScalarsPluginConfig,
19+
},
20+
},
21+
};
22+
```
23+
24+
This will generate an `inputObjects` object in the generated file that can be used to configure the `inputObjects` option for `InMemoryCache`.
25+
26+
```ts
27+
import { inputObjects } from "./path/to/custom-scalars";
28+
29+
const cache = new InMemoryCache({
30+
inputObjects,
31+
});
32+
```

0 commit comments

Comments
 (0)