From 04790915a85e9f5e253fb357d350a2a7e72890f2 Mon Sep 17 00:00:00 2001 From: Mohamed Saad <34938477+mohamedsaad4@users.noreply.github.com> Date: Mon, 15 Jul 2019 15:37:23 +0200 Subject: [PATCH] add informations about queries in graphql (#36428) --- guide/english/graphql/index.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/guide/english/graphql/index.md b/guide/english/graphql/index.md index c52b0bd389..b3f2ff479a 100644 --- a/guide/english/graphql/index.md +++ b/guide/english/graphql/index.md @@ -18,7 +18,30 @@ npm install graphql --save ``` ## Queries - + +A query is the shape of the request that get back the exact data you asked for, not the whole object like in REST approach. You can write your query like that:- + +``` +{ + hero { + name + } +} +``` + +and then the output is like that:- + +``` +{ + "data": { + "hero": { + "name": "R2-D2" + } + } +} +``` + +note that the returned data has a special structure which starts with "data" and it has the same structure as the request. ## Mutations