Major Changes
-
545c470: Change
fetchParams
configuration option from object to string.The string will be inserted 1:1 into the generated code. This is a breaking change!This allows more flexibility for customization. Here are some examples:
Use an imported object for configuration
schema: MY_SCHEMA_PATH documents: './src/**/*.graphql' generates: ./generates.ts: plugins: - add: content: "import { endpointUrl, fetchParams } from './my-config';" - typescript - typescript-operations - typescript-react-query config: fetcher: endpoint: 'endpointUrl' fetchParams: 'fetchParams'
Use environment variables for configuration
schema: MY_SCHEMA_PATH documents: './src/**/*.graphql' generates: ./generates.ts: plugins: - typescript - typescript-operations - typescript-react-query config: fetcher: endpoint: 'endpointUrl' # Multiline string fetchParams: > { headers: { apiKey: process.env.APIKEY, somethingElse: process.env.SOMETHING, }, }
-
5dc59c8: Queries without variables will no longer have an undefined entry in their query key
Minor Changes
- 99af506: Allow passing
headers
tographql-request
.
Patch Changes
- ec2cba5: [typescript-react-query] Pass dataSource as argument to fetcher