graphql-code-generator-community icon indicating copy to clipboard operation
graphql-code-generator-community copied to clipboard

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

Open mtlewis opened this issue 1 year ago • 0 comments

Which packages are impacted by your issue?

@graphql-codegen/typescript-graphql-request

Describe the bug

The defaultWrapper generated by this package looks like this:

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 is set to true.

Note - I'm skipping putting together an example, since this has already been reported. 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

mtlewis avatar Jan 03 '24 16:01 mtlewis