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

fix(GraphQL Node): Change default request format to json instead of graphql #11346

Conversation

ayatnkw
Copy link
Contributor

@ayatnkw ayatnkw commented Oct 22, 2024

Summary

This PR attempts to make the current Graphql node less confusing by

  • setting the default request format content type to json instead of graphql (not many servers support this anymore)
  • throwing an error that prompts the user to change the request format from graphql to json
  • adding descriptions to these options for more clarity

https://linear.app/n8n/issue/NODE-1018/make-using-different-flavours-of-graphql-less-confusing

It also changes the Query field from type json to string:
https://linear.app/n8n/issue/NODE-1050/bug-json-field-for-graphql-nodes-for-query-field-is-wrong

Related Linear tickets, Github issues, and Community forum posts

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team node/improvement New feature or request labels Oct 22, 2024
@ayatnkw ayatnkw marked this pull request as ready for review November 8, 2024 12:35
@ayatnkw ayatnkw requested a review from ShireenMissi November 8, 2024 12:36
@Joffcom
Copy link
Member

Joffcom commented Nov 18, 2024

@ayatnkw at the moment these changes break the node for existing users, If you are changing default values you need to add a light version. If you look at the v1 Google Sheet node you can see where we did this for changing the default auth option from Service Account to OAuth.

@ayatnkw ayatnkw force-pushed the node-1018-make-using-different-flavours-of-graphql-less-confusing branch from f8350aa to 70c188a Compare December 5, 2024 04:20
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@ayatnkw ayatnkw requested a review from Joffcom December 5, 2024 16:05
@ayatnkw
Copy link
Contributor Author

ayatnkw commented Dec 5, 2024

thanks for the feedback @Joffcom, made the changes you suggested and requested a review!

Copy link
Contributor

@dana-gill dana-gill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far :) Thanks for doing this. Could you also add a workflow test to test that we are indeed throwing an error when we're not using the JSON request format? Feel free to have a look at e71076c for some more information

@ShireenMissi ShireenMissi force-pushed the node-1018-make-using-different-flavours-of-graphql-less-confusing branch from d02aa52 to df6a17e Compare January 14, 2025 17:08
@dana-gill dana-gill self-requested a review January 14, 2025 17:10
Copy link
Contributor

@dana-gill dana-gill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added 2bc02b35d559595976bb77870fd7e99bfa124411 which throws the error requesting users to use the Request JSON format since response.errors was undefined (I don't think errors is a field which exists on the response object actually)

dana-gill
dana-gill previously approved these changes Jan 15, 2025
Copy link
Contributor

@dana-gill dana-gill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beyond that, LGTM :)

Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link

cypress bot commented Jan 15, 2025

n8n    Run #8786

Run Properties:  status check passed Passed #8786  •  git commit b63212ed48: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ayatnkw 🗃️ e2e/*
Project n8n
Branch Review node-1018-make-using-different-flavours-of-graphql-less-confusing
Run status status check passed Passed #8786
Run duration 04m 45s
Commit git commit b63212ed48: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ayatnkw 🗃️ e2e/*
Committer Shireen Missi
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 489
View all changes introduced in this branch ↗︎

Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

@ShireenMissi ShireenMissi force-pushed the node-1018-make-using-different-flavours-of-graphql-less-confusing branch from 63fc4a5 to b63212e Compare January 16, 2025 16:21
Copy link
Contributor

✅ All Cypress E2E specs passed

@ShireenMissi ShireenMissi merged commit c7c122f into master Jan 16, 2025
37 checks passed
@ShireenMissi ShireenMissi deleted the node-1018-make-using-different-flavours-of-graphql-less-confusing branch January 16, 2025 17:06
adrian-martinez-onestic pushed a commit to onesdata/n8n-fork that referenced this pull request Jan 17, 2025
adrian-martinez-onestic pushed a commit to onesdata/n8n-fork that referenced this pull request Jan 17, 2025
adrian-martinez-onestic pushed a commit to onesdata/n8n-fork that referenced this pull request Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team node/improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants