Skip to content

fix: Issue with incorrect OperationName applied on GraphQL request #6074

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

Merged
merged 2 commits into from
Jul 11, 2023

Conversation

pukuba
Copy link
Contributor

@pukuba pukuba commented Jun 29, 2023

changelog(Fixes): Fixed an issue where the Operation Name wasn't being correctly transferred to the GraphQL Body when modifying the GraphQL Query

I've made changes to correct an issue where the Operation Name wasn't being correctly transferred to the GraphQL Body when modifying the GraphQL Query.

There might be a connection with issue #5752

There were two primary issues:

  • an issue was observed where the previous Operation Name was passed to the GraphQL Body, even when the Operation Name in the GraphQL Query was empty. To address this, we've adjusted the logic so that if the Operation Name is absent, the state.body.operationName deleted, preventing it from being transferred.

  • there was a delay in the application of changes to the Operation Name in the GraphQL Query. To rectify this, the getGraphQLContent function has been updated to include the current Operation Name as an argument when called, ensuring its immediate application.

@pukuba pukuba force-pushed the fix/graphql-operation-name-issue branch from 9b9ba03 to c460943 Compare June 29, 2023 18:04
@jackkav jackkav force-pushed the fix/graphql-operation-name-issue branch from bfeaa44 to 695163c Compare July 11, 2023 14:48
@jackkav
Copy link
Contributor

jackkav commented Jul 11, 2023

Thanks! @pukuba

@jackkav jackkav enabled auto-merge July 11, 2023 14:48
@jackkav jackkav added this pull request to the merge queue Jul 11, 2023
Merged via the queue into Kong:develop with commit 7b41622 Jul 11, 2023
@pukuba pukuba deleted the fix/graphql-operation-name-issue branch July 11, 2023 15:28
@filfreire
Copy link
Contributor

@pukuba you can claim a free tshirt for this PR contribution - find more at https://konghq.com/community/open-source-contribution

jackkav pushed a commit to jackkav/insomnia that referenced this pull request Nov 24, 2023
…ong#6074)

* fix: Retained operation name in GraphQL requests

* fix: Ensure Immediate Reflection of operationName Changes in GraphQL Query
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

Successfully merging this pull request may close these issues.

3 participants