-
Notifications
You must be signed in to change notification settings - Fork 162
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
feat: [graphql-request] pass variables to wrapper function #512
feat: [graphql-request] pass variables to wrapper function #512
Conversation
🦋 Changeset detectedLatest commit: f4e830f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
btw there is a failed test in master, I don't think it's my responsibility to fix it, so I leave it as is. FAIL packages/presets/near-operation-file/tests/near-operation-file.spec.ts
● near-operation-file preset › Issues › #6439 - generating code only for the last query inside a file
expect(received).toMatchInlineSnapshot(snapshot)
Snapshot name: `near-operation-file preset Issues #6439 - generating code only for the last query inside a file 1`
- Snapshot - 1
+ Received + 1
@@ -1,6 +1,6 @@
- import * as Types from '../../../../../out1.ts/types';
+ import * as Types from '../../../../plugins/typescript/graphql-request/out1.ts/types'; |
@dotansimha @saihaj Can you please review this MR? |
just want to follow this up, @saihaj please review when you got a minute |
ping @saihaj @dotansimha |
released @graphql-codegen/[email protected] |
|
||
|
||
const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType) => action(); | ||
const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType, variables) => action(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeScript is yelling because of that line:
error TS6133: 'variables' is declared but its value is never read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing the same here after pulling in latest of graphql-request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 IMPORTANT: Please do not create a Pull Request without creating an issue first.
Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of
the pull request.
Description
Pass operation variables to wrapper function, so the wrapper function can use the variables to do conditional logic.
Related # (issue) #511
Type of change
Please delete options that are not relevant.
expected)
Screenshots/Sandbox (if appropriate/relevant):
Adding links to sandbox or providing screenshots can help us understand more about this PR and take
action on it as appropriate
How Has This Been Tested?
Updated the unit tests
Test Environment:
@graphql-codegen/...
:Checklist:
CONTRIBUTING doc and the
style guidelines of this project
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose
the solution you did and what alternatives you considered, etc...