Dab tsi yog qhov txawv ntawm GraphQL kev hloov pauv thiab cov lus nug?
Dab tsi yog qhov txawv ntawm GraphQL kev hloov pauv thiab cov lus nug?

Video: Dab tsi yog qhov txawv ntawm GraphQL kev hloov pauv thiab cov lus nug?

Video: Dab tsi yog qhov txawv ntawm GraphQL kev hloov pauv thiab cov lus nug?
Video: Qhov Sib Txawv Ntawm Allergy, Flu & Coronavirus Yog Dab Tsi 2024, Kaum ib hlis
Anonim

Hauv lus yooj yim cov nug yog SELECT nqe lus thiab kev hloov pauv yog INSERT Operation. Query hauv graphql yog siv los nqa cov ntaub ntawv thaum kev hloov pauv yog siv rau INSERT/UPDATE/DELETE ua haujlwm.

Ntxiv rau qhov no, cov lus nug thiab kev hloov pauv hauv GraphQL yog dab tsi?

GraphQL - Kev hloov pauv . Hloov cov lus nug hloov kho cov ntaub ntawv hauv cov ntaub ntawv khaws cia thiab xa rov qab tus nqi. Nws tuaj yeem siv los ntxig, hloov kho, lossis tshem tawm cov ntaub ntawv. Kev hloov pauv txhais tau tias yog ib feem ntawm lub schema.

Tom qab ntawd, lo lus nug yog, qhov txawv ntawm so thiab GraphQL yog dab tsi? Hauv REST , koj yuav tsum hu rau ntau qhov kawg kom tau txais cov peev txheej ntsig txog. txawv : Hauv GraphQL , tsis muaj qhov sib txawv ntawm cov teb ntawm hom lus nug thiab cov teb ntawm lwm hom, tshwj tsis yog tias tsuas yog hom lus nug tuaj yeem nkag tau ntawm lub hauv paus ntawm cov lus nug. Hauv GraphQL , koj hloov lo lus tseem ceeb hauv nug.

Kuj nug, GraphQL lus nug yog dab tsi?

A GraphQL lus nug yog siv los nyeem lossis nqa cov txiaj ntsig thaum kev hloov pauv yog siv los sau lossis tshaj tawm qhov txiaj ntsig. Nyob rau hauv ob qho tib si, kev ua haujlwm yog ib txoj hlua yooj yim uas a GraphQL server tuaj yeem txheeb xyuas thiab teb nrog cov ntaub ntawv hauv ib hom ntawv tshwj xeeb. GraphQL cov lus nug pab kom txo tau cov ntaub ntawv.

GraphQL puas tuaj yeem hloov kho cov ntaub ntawv?

1 Teb. Yog, txhua qhov kev hloov pauv piav qhia txog qhov tshwj xeeb uas ua ua tau ua rau me ntsis ntawm cov ntaub ntawv . GraphQL tsis zoo li REST - nws tsis qhia meej txog CRUD hom kev ua. Thaum koj sau ntawv hloov mus rau hloov tshiab qee cov ntaub ntawv , koj muaj ob txoj kev xaiv.

Pom zoo: