dotansimha / dotansimha/graphql-code-generator-community

Generated defaultWrapper includes an unused parameter not prefixed with `_`

Open
#558 0 comments 2 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-graphql-request

### Describe the bug

The `defaultWrapper` generated by this package looks like this:

```typescript
const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType, variables) => action();
```

The `variables` parameter is not used, and since it's not prefixed with `_`, compiling the code with TS produces errors when [noUnusedParameters](https://www.typescriptlang.org/tsconfig#noUnusedParameters) is set to true.

Note - I'm skipping putting together an example, since this has already been [reported](https://github.com/dotansimha/graphql-code-generator-community/pull/512/files#r1431039116). Hope that's OK!

### Your Example Website or App

https://github.com/dotansimha/graphql-code-generator-community/pull/512/files#r1431039116

### Steps to Reproduce the Bug or Issue

1. Generate a schema using the plugin
2. Compile the schema with `noUnusedParameters` set to true

### Expected behavior

TS shouldn't produce errors regardless of the value of noUnusedParameters

### Screenshots or Videos

_No response_

### Platform

- OS: macOS
- NodeJS: 20
- `graphql` version: [e.g. 16.3.0]
- `@graphql-codegen/*` version(s):

### 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.