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

[Bug]: GraphQL queries with JS bindings have started failing since recent update #32748

Closed
1 task done
GreenFlux opened this issue Apr 17, 2024 · 0 comments · Fixed by #32760
Closed
1 task done

[Bug]: GraphQL queries with JS bindings have started failing since recent update #32748

GreenFlux opened this issue Apr 17, 2024 · 0 comments · Fixed by #32760
Assignees
Labels
Bug Something isn't working Critical This issue needs immediate attention. Drop everything else Datasources Issues related to configuring datasource on appsmith GraphQL Plugin Issues related to GraphQL plugin Integrations Product Issues related to a specific integration Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Production QA Pod Issues under the QA Pod QA Needs QA attention Query & JS Pod Issues related to the query & JS Pod

Comments

@GreenFlux
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description

A Discord user reported that GraphQL queries with JS bindings in the body have recently started failing, with no new edits to the app. The same query works with the bindings removed and the same value inserted as text. More info here:
https://discord.com/channels/725602949748752515/1230134890704539709

Steps To Reproduce

@sneha122 has reproduced, and confirmed that turning off smart substitution does not resolve the issue.

Public Sample App

No response

Environment

Production

Severity

Critical (Broken Production apps)

Issue video log

No response

Version

Appsmith v1.22.0-SNAPSHOT

@GreenFlux GreenFlux added Bug Something isn't working Datasources Issues related to configuring datasource on appsmith Needs Triaging Needs attention from maintainers to triage GraphQL Plugin Issues related to GraphQL plugin Integrations Product Issues related to a specific integration labels Apr 17, 2024
@Nikhil-Nandagopal Nikhil-Nandagopal added Critical This issue needs immediate attention. Drop everything else Medium Issues that frustrate users due to poor UX Production labels Apr 17, 2024
@github-actions github-actions bot added the Query & JS Pod Issues related to the query & JS Pod label Apr 17, 2024
sneha122 added a commit that referenced this issue Apr 18, 2024
## Description
This PR resolved issue with graphQL, where if we create a graphQL with a
binding and run such query, it returns with error response saying the
query execution has timed out. A user had raised this issue
[here](https://discord.com/channels/725602949748752515/1230134890704539709).

### Root cause:
The issue was not at all reproducible on local, but It was continuously
erroring out on production, release and even DPs. From the logs, we can
see that issue was with `GraphQLDataTypeUtils.java` class. This class
was somehow not getting initialised. This was due to recent changes made
in [PR](#32595), where the
version for package was updated to v2.17.0, on local it was compiling
properly but on release, production and other builds, it still seems to
be referencing to the older version of it, we do not know the reason of
it right now, we should further investigate this. But since this was a
critical issue and we need to get user unblocked, we are going ahead
with an alternate fix where we have moved the initialisation of
objectMapper to serialisationUtils.java file.

![Screenshot 2024-04-18 at 11 22 55
AM](https://github.com/appsmithorg/appsmith/assets/30018882/9735aaed-07c2-402b-a798-d7a4c1b67a19)

### Steps to reproduce the issue:
1. Drag and drop a text widget on canvas, change text value to `US`
2. Create a new graphQL query with url as
`https://countries.trevorblades.com/`
3. Add following in the query body and execute the API

```
{
  country(code: {{Text1.text}}) {
    name
	}
}
```


Fixes #32748
_or_  
Fixes [`Issue
URL`](#32748)
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8735651316>
> Commit: a03f29f
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8735651316&attempt=2"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->





<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Updated serialization configuration across various data types and
plugins to enhance functionality and compatibility using a centralized
utility method.
- **New Features**
- Introduced a new method to standardize object mapper configurations,
improving serialization processes across the application.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: “sneha122” <“sneha@appsmith.com”>
@appsmith-bot appsmith-bot added the QA Needs QA attention label Apr 18, 2024
@github-actions github-actions bot added the QA Pod Issues under the QA Pod label Apr 18, 2024
sneha122 pushed a commit that referenced this issue Apr 18, 2024
This PR resolved issue with graphQL, where if we create a graphQL with a
binding and run such query, it returns with error response saying the
query execution has timed out. A user had raised this issue
[here](https://discord.com/channels/725602949748752515/1230134890704539709).

The issue was not at all reproducible on local, but It was continuously
erroring out on production, release and even DPs. From the logs, we can
see that issue was with `GraphQLDataTypeUtils.java` class. This class
was somehow not getting initialised. This was due to recent changes made
in [PR](#32595), where the
version for package was updated to v2.17.0, on local it was compiling
properly but on release, production and other builds, it still seems to
be referencing to the older version of it, we do not know the reason of
it right now, we should further investigate this. But since this was a
critical issue and we need to get user unblocked, we are going ahead
with an alternate fix where we have moved the initialisation of
objectMapper to serialisationUtils.java file.

![Screenshot 2024-04-18 at 11 22 55
AM](https://github.com/appsmithorg/appsmith/assets/30018882/9735aaed-07c2-402b-a798-d7a4c1b67a19)

1. Drag and drop a text widget on canvas, change text value to `US`
2. Create a new graphQL query with url as
`https://countries.trevorblades.com/`
3. Add following in the query body and execute the API

```
{
  country(code: {{Text1.text}}) {
    name
	}
}
```

Fixes #32748
_or_
Fixes [`Issue
URL`](#32748)
> [!WARNING]
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

/ok-to-test tags="@tag.All"

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8735651316>
> Commit: a03f29f
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8735651316&attempt=2"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

- **Refactor**
- Updated serialization configuration across various data types and
plugins to enhance functionality and compatibility using a centralized
utility method.
- **New Features**
- Introduced a new method to standardize object mapper configurations,
improving serialization processes across the application.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: “sneha122” <“sneha@appsmith.com”>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Critical This issue needs immediate attention. Drop everything else Datasources Issues related to configuring datasource on appsmith GraphQL Plugin Issues related to GraphQL plugin Integrations Product Issues related to a specific integration Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Production QA Pod Issues under the QA Pod QA Needs QA attention Query & JS Pod Issues related to the query & JS Pod
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants