Skip to content

GraphQL#

GraphQL เป็นภาษา query และ runtime สำหรับ API แบบ open-source ใช้สำหรับดึงและแก้ไขข้อมูลจาก endpoint ที่รองรับ GraphQL ใช้ GraphQL node เพื่อ query endpoint แบบ GraphQL

Node parameters#

This node can be used as an AI tool

This node can be used to enhance the capabilities of an AI agent. When used in this way, many parameters can be set automatically, or with information directed by AI - find out more in the AI tool parameters documentation.

Authentication#

เลือกประเภท authentication ที่ต้องการใช้

ถ้าเลือกอย่างอื่นที่ไม่ใช่ None จะมี parameter Credential for ให้เลือกหรือสร้าง credential สำหรับ authentication นั้น

HTTP Request Method#

เลือก HTTP Request method ที่ node จะใช้ มีให้เลือก:

  • GET
  • POST: ถ้าเลือก POST ต้องเลือก Request Format สำหรับ query payload มีให้เลือก:
    • GraphQL (Raw)
    • JSON

Endpoint#

กรอก GraphQL Endpoint ที่ต้องการเชื่อมต่อ

Ignore SSL Issues#

ถ้าเปิด option นี้ n8n จะไม่ตรวจสอบ SSL certificate

Query#

กรอก GraphQL query ที่ต้องการรัน

ดูข้อมูลการเขียน query เพิ่มเติมได้ที่ Related Resources

Response Format#

เลือก format ที่ต้องการรับผลลัพธ์ query มีให้เลือก:

  • JSON
  • String: ถ้าเลือกแบบนี้ ให้กรอก Response Data Property Name เพื่อกำหนด property ที่จะเก็บ string

Headers#

กรอก Headers ที่ต้องการส่งไปกับ query เป็นคู่ Name / Value

Templates and examples#

Get top 5 products on Product Hunt every hour

by Harshil Agrawal

View template details
API queries data from GraphQL

by Jan Oberhauser

View template details
Sentiment Analysis Tracking on Support Issues with Linear and Slack

by Jimleuk

View template details
Browse GraphQL integration templates, or search all templates

ถ้าจะใช้ GraphQL node ควรเข้าใจภาษา query ของ GraphQL ดู tutorial ได้ที่ Introduction to GraphQL