dotansimha / dotansimha/graphql-code-generator-community

Unexpected Result with Nullish Coalescing and Ternary Operators in React Query's infinite query key

Open
#786 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
137
Forks
195
Avg merge
6h 20m
Merged PRs (30d)
16

Description

### Which packages are impacted by your issue?

@graphql-codegen/typescript-react-query

### Describe the bug

While using the generated infinite query function and providing the queryKey option, it uses the [XXX.infinite] instead of the provided queryKey.

- ![CleanShot 2024-07-19 at 16 51 55](https://github.com/user-attachments/assets/1d25dde8-72fd-4c05-8fa9-b193f33342d7)

### Your Example Website or App

https://github.com/nanopang/graphql-code-generator-community/commit/95c2a728a3d23278c821d5e5734cec0b23a8c1e2

### Steps to Reproduce the Bug or Issue

1. Codegen typescript-react-query with addInfiniteQuery
2.Pass the queryKey value to the generated Infinite query
3.It will ignore the queryKey

### Expected behavior

use the provided optionsQueryKey instead of the [XXX.infinite]

### Screenshots or Videos

_No response_

### Platform

- OS: MacOS
- NodeJS: 20.12.2
- `graphql` version:16.8.1
- `@graphql-codegen/typescript-react-query` version(s): 6.1.0

### Codegen Config File

_No response_

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.