release-1718272997249
版本发布时间: 2024-06-13 18:03:17
dotansimha/graphql-code-generator最新发布版本:release-1722174286560(2024-07-28 21:44:46)
@graphql-codegen/add@5.0.3
Patch Changes
-
#9987
5501c62
Thanks @taro-28! - Export configuration types (e.g.AddPluginConfig
) from the entry point.import type { AddPluginConfig } from '@graphql-codegen/add';
@graphql-codegen/client-preset@4.3.0
Minor Changes
-
#10001
1be6e65
Thanks @n1ru4l! - Support discriminatingnull
andundefined
within theuseFragment
function.function MyComponent(props: FragmentType<typeof MyFragment> | null) { const data = useFragment(MyFragment, props); // data is `MyFragment | null` } function MyComponent(props: FragmentType<typeof MyFragment> | undefined) { const data = useFragment(MyFragment, props); // data is `MyFragment | undefined` }
Before, the returned type from
useFragment
was alwaysTType | null | undefined
. -
#9804
5e594ef
Thanks @rachel-church! - PreservingArray<T>
orReadonlyArray<T>
inuseFragment()
return type.
Patch Changes
-
#9996
99f449c
Thanks @nahn20! - Added configuration to allow for custom hash functions for persisted documents in the client presetExample
import { type CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { schema: 'schema.graphql', documents: ['src/**/*.tsx'], generates: { './src/gql/': { preset: 'client', presetConfig: { persistedDocuments: { hashAlgorithm: operation => { const shasum = crypto.createHash('sha512'); shasum.update(operation); return shasum.digest('hex'); }, }, }, }, }, };
-
Updated dependencies [
5501c62
]:- @graphql-codegen/add@5.0.3