Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated defaultWrapper includes an unused parameter not prefixed with _ #558

Open
mtlewis opened this issue Jan 3, 2024 · 0 comments
Open

Comments

@mtlewis
Copy link
Contributor

mtlewis commented Jan 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant