Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/funky-baboons-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@harnessio/oats-plugin-react-query-harness': minor
---

Fixed the issue where imports from params were not being added to the global set of imports

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should update the link in the readme.md as well

File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ You can also check the [examples](./examples/) folder for usage.

This repo uses [pnpm](https://pnpm.io/) as a package manager and [changesets](https://github.com/changesets/changesets) for versioning.

Check out the [development docs](./docs/development.md) for more info.
Check out the [development docs](./CONTRIBUTING.md) for more info.

## License

Expand Down
4 changes: 4 additions & 0 deletions packages/plugin-react-query-harness/src/processOperation.mts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export function processOperation(op: IOperation, config: IConfig): ICodeOutput {
const headerParamsCode =
headerParams.length > 0 ? liquid.renderSync(OBJECT_TEMPLATE, { props: headerParams }) : null;

queryParams.forEach((queryParam) => queryParam.imports.forEach((imp) => imports.add(imp)));
pathParams.forEach((pathParam) => pathParam.imports.forEach((imp) => imports.add(imp)));
headerParams.forEach((headerParam) => headerParam.imports.forEach((imp) => imports.add(imp)));

const templateProps = {
hookName,
fetcherPropsName,
Expand Down
Loading