File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments