การแก้ไข Persisted Query ระดับต่ำ
ทำให้ directives ที่ปกติซ่อนอยู่ (ซึ่งเพิ่มฟังก์ชันการทำงานให้กับ GraphQL server) มองเห็นได้เมื่อแก้ไข persisted query
คำอธิบาย
ใน GraphQL, directives คือฟังก์ชันที่ช่วยให้สามารถปรับเปลี่ยนผลลัพธ์จาก field ได้ ตัวอย่างเช่น directive @strUpperCase จะแปลงค่าของ field ให้เป็นตัวพิมพ์ใหญ่
Directives มี 2 ประเภท: ประเภทที่ใช้กับ schema และทำงานเสมอในทุก queries; และประเภทที่ใช้กับ query โดยผู้ใช้หรือแอปพลิเคชันบนฝั่ง client
ใน Gato GraphQL, ฟังก์ชันการทำงานจำนวนมากที่เกี่ยวข้องกับการ resolve query นั้นดำเนินการผ่าน directives ที่ใช้กับ schema
ตัวอย่างเช่น Cache Control ทำงานโดยการใช้ directive @cacheControl กับ schema การกำหนดค่านี้จะถูกซ่อนโดยค่าเริ่มต้น และดำเนินการโดย plugin ผ่านอินเทอร์เฟซผู้ใช้:

ในทำนองเดียวกัน directives เหล่านี้ให้การควบคุมการเข้าถึง (Access Control) สำหรับ fields (และ directives ที่คล้ายกันให้การควบคุมการเข้าถึงสำหรับ directives):
@disableAccess@validateIsUserLoggedIn@validateIsUserNotLoggedIn@validateDoesLoggedInUserHaveAnyRole.@validateDoesLoggedInUserHaveAnyCapability@validateDoesVisitorComeFromAnyAllowedIP@validateDoesVisitorNotComeFromAnyDeniedIP
extension Low-Level Persisted Query Editing นี้ทำให้ directives ทั้งหมดที่ใช้กับ schema พร้อมใช้งานใน GraphiQL editor เมื่อแก้ไข persisted queries ช่วยให้คุณสามารถหลีกเลี่ยงอินเทอร์เฟซผู้ใช้และเพิ่ม directives ประเภท schema ลงใน persisted query ได้โดยตรง

ตัวอย่างเช่น การกำหนด Cache Control สามารถทำได้โดยตรงใน persisted query โดยการตั้งค่า directive @cacheControl พร้อม argument maxAge บน field; หรือสามารถกำหนด Access Control ได้โดยตรง โดยการเพิ่ม directive @validate... ที่เกี่ยวข้องลงบน field โดยตรง:
