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

GraphQL responses are treated as file #10870

Closed
5 tasks done
DavideDelbiancoZucchetti opened this issue Nov 19, 2024 · 2 comments
Closed
5 tasks done

GraphQL responses are treated as file #10870

DavideDelbiancoZucchetti opened this issue Nov 19, 2024 · 2 comments
Assignees
Labels
🐞 bug Something isn't working good first issue Good first issue for newcomers

Comments

@DavideDelbiancoZucchetti
Copy link

DavideDelbiancoZucchetti commented Nov 19, 2024

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.11.2

Cloud or Self Hosted

Cloud, Self Hosted (Docker), Self Hosted (Source)

Steps to reproduce

Create an HTTP node that executes a POST request to a graphQL endpoint

✔️ Expected Behavior

The response should be in the body property and not in file

❌ Actual Behavior

Because of a change in PR #8818 a variable name NON_FILE_CONTENT_TYPES was introduced in api/core/workflow/nodes/http_request/entities.py and breaks graphql responses that have content type: "application/graphql-response+json; charset=utf-8"

Copy link

dosubot bot commented Nov 19, 2024

Hello @DavideDelbiancoZucchetti! I'm here to assist you with any bugs, questions, or contributions. Let's dive into the issue and work together to find a solution.

The issue you're experiencing is due to the introduction of the NON_FILE_CONTENT_TYPES variable in entities.py, which does not include the content type "application/graphql-response+json; charset=utf-8". This causes GraphQL responses to be incorrectly treated as files. To resolve this, you should add "application/graphql-response+json" to the NON_FILE_CONTENT_TYPES tuple in the code. Here's how you can modify it:

NON_FILE_CONTENT_TYPES = (
    "application/json",
    "application/xml",
    "text/html",
    "text/plain",
    "application/x-www-form-urlencoded",
    "application/graphql-response+json",
)

This change will ensure that GraphQL responses with the specified content type are handled correctly [1].

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the 🐞 bug Something isn't working label Nov 19, 2024
@crazywoola crazywoola added the good first issue Good first issue for newcomers label Nov 20, 2024
@laipz8200
Copy link
Member

Link to #10862

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working good first issue Good first issue for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants