{"id":133594,"date":"2018-07-16T05:47:15","date_gmt":"2018-07-16T05:47:15","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=133594"},"modified":"2025-12-30T10:52:15","modified_gmt":"2025-12-30T10:52:15","slug":"graphql-implementation-in-magento2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/","title":{"rendered":"How to Implement GraphQL in Magento 2"},"content":{"rendered":"\n<p>Modern eCommerce applications demand fast, flexible, and efficient data retrieval\u2014especially for headless storefronts, mobile apps, and PWAs. This is where <strong>GraphQL<\/strong> comes into play.<\/p>\n\n\n\n<p><strong>What Is GraphQL? (Simple &amp; Clear Explanation)<\/strong><\/p>\n\n\n\n<p><strong>GraphQL<\/strong> is a modern query language for APIs created by Facebook.<\/p>\n\n\n\n<p><br>Unlike REST APIs\u2014where you often fetch too much or too little data\u2014GraphQL allows clients to request <strong>exactly what they need<\/strong>, and nothing more.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Key Advantages of GraphQL<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Single endpoint<\/strong> (no more multiple REST URLs)<\/li>\n\n\n\n<li><strong>Client controls the response<\/strong> (fetch only required fields)<\/li>\n\n\n\n<li><strong>Fewer network calls<\/strong> (batching of queries)<\/li>\n\n\n\n<li><strong>Strongly typed schema<\/strong> (makes APIs predictable)<\/li>\n\n\n\n<li><strong>Perfect for headless Magento, PWAs, and mobile apps<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Magento 2 adopted GraphQL to support Luma, PWA Studio, and modern headless architectures.<\/p>\n\n\n\n<p><br>But often, you need to build <strong>custom GraphQL endpoints<\/strong> for business logic\u2014and that\u2019s exactly what we\u2019ll do in this blog.<\/p>\n\n\n\n<p>GraphQL uses types to ensure channel only ask for what\u2019s possible and provide clear and helpful errors. Also, you can check <a href=\"https:\/\/webkul.com\/blog\/magento2-custom-rest-api\/\">how to create REST API in Magento 2<\/a>.<\/p>\n\n\n\n<p>This blog assumes your familiarity with GraphQL concepts. If it is not the case &#8211; first learn about GraphQL on&nbsp;the official website&nbsp;or you can read our previous blog <a href=\"https:\/\/webkul.com\/blog\/how-to-use-graphql-in-php\/\">How to use GraphQL in php<\/a>.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>What We Will Build<\/strong><\/h1>\n\n\n\n<p>We will create a Magento 2 GraphQL module that provides a <strong>custom query<\/strong>:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>customerDetails<\/code><\/h3>\n\n\n\n<p>This query will return the logged-in customer\u2019s:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ID<\/li>\n\n\n\n<li>Firstname<\/li>\n\n\n\n<li>Lastname<\/li>\n\n\n\n<li>Email<\/li>\n<\/ul>\n\n\n\n<p>And we will secure it so that <strong>only authenticated customers<\/strong> can access it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. Module Folder Structure<\/strong><\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\">app\/code\/Webkul\/CustomerGraphQl\/\n\u2502\n\u251c\u2500\u2500 etc\n\u2502   \u2514\u2500\u2500 module.xml\n\u2502\n\u251c\u2500\u2500 etc\/schema.graphqls\n\u2502\n\u251c\u2500\u2500 registration.php\n\u2502\n\u2514\u2500\u2500 Model\/Resolver\/CustomerDetails.php<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. module.xml<\/strong><br><\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;\n        xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:Module\/etc\/module.xsd&quot;&gt;\n\n    &lt;module name=&quot;Webkul_CustomerGraphQl&quot;\/&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3. registration.php<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\nuse Magento\\Framework\\Component\\ComponentRegistrar;\n\nComponentRegistrar::register(\n    ComponentRegistrar::MODULE,\n    &#039;Webkul_CustomerGraphQl&#039;,\n    __DIR__\n);<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><strong>4. schema.graphqls<\/strong><\/strong><\/h2>\n\n\n\n<p>This defines the GraphQL type and query.<\/p>\n\n\n\n<p><code>app\/code\/Webkul\/CustomerGraphQl\/etc\/schema.graphqls<\/code><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">type CustomerDetailsOutput {\n    id: Int\n    firstname: String\n    lastname: String\n    email: String\n}\n\ntype Query {\n    customerDetails: CustomerDetailsOutput \n        @resolver(class: &quot;Webkul\\\\CustomerGraphQl\\\\Model\\\\Resolver\\\\CustomerDetails&quot;)\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">5. Resolver to Return Logged-In Customer Data<\/h2>\n\n\n\n<p>app\/code\/Webkul\/CustomerGraphQl\/Model\/Resolver\/CustomerDetails.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\nnamespace Webkul\\CustomerGraphQl\\Model\\Resolver;\n\nuse Magento\\CustomerGraphQl\\Model\\Customer\\GetCustomer;\nuse Magento\\Framework\\GraphQl\\Query\\ResolverInterface;\nuse Magento\\Framework\\GraphQl\\Config\\Element\\Field;\nuse Magento\\Framework\\GraphQl\\Schema\\Type\\ResolveInfo;\nuse Magento\\Framework\\GraphQl\\Exception\\GraphQlAuthorizationException;\n\nclass CustomerDetails implements ResolverInterface\n{\n    \/**\n     * @var GetCustomer\n     *\/\n    private $getCustomer;\n\n    public function __construct(\n        GetCustomer $getCustomer\n    ) {\n        $this-&gt;getCustomer = $getCustomer;\n    }\n\n    \/**\n     * Resolver method for GraphQL\n     *\n     * @param Field $field\n     * @param \\Magento\\GraphQl\\Model\\Query\\ContextInterface $context\n     * @param ResolveInfo $info\n     * @param array $value\n     * @param array $args\n     *\/\n    public function resolve(\n        Field $field,\n        $context,\n        ResolveInfo $info,\n        array $value = null,\n        array $args = null\n    ) {\n        if ($context-&gt;getExtensionAttributes()-&gt;getIsCustomer() === false)    {\n                throw new GraphQlAuthorizationException(\n                    __(&#039;The current customer isn\\&#039;t authorized.&#039;)\n                );\n        }\n        $customer = $this-&gt;getCustomer-&gt;execute($context);\n\n        return &#091;\n            &#039;id&#039;        =&gt; $customer-&gt;getId(),\n            &#039;firstname&#039; =&gt; $customer-&gt;getFirstname(),\n            &#039;lastname&#039;  =&gt; $customer-&gt;getLastname(),\n            &#039;email&#039;     =&gt; $customer-&gt;getEmail()\n        ];\n    }\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">6. Run Magento Commands<\/h2>\n\n\n\n<p>Run the following commands after adding the module:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento setup:upgrade\nphp bin\/magento cache:flush<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">7. How to Test the Query<\/h2>\n\n\n\n<p><strong>Generate Customer Token<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">mutation {\n  generateCustomerToken(email: &quot;test@example.com&quot;, password: &quot;Test@123&quot;) {\n    token\n  }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Add Header<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\">Authorization: Bearer &lt;customer-token&gt;<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Run the Custom Query<\/h4>\n\n\n\n<p>{<br>    customerDetails {<br>        id<br>        firstname<br>        lastname<br>        email<br>    }<br>}<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Example Response<\/h2>\n\n\n\n<p>{<br>    &#8220;data&#8221;: {<br>        &#8220;customerDetails&#8221;: {<br>            &#8220;id&#8221;: 12,<br>            &#8220;firstname&#8221;: &#8220;John&#8221;,<br>            &#8220;lastname&#8221;: &#8220;Doe&#8221;,<br>            &#8220;email&#8221;: &#8220;john.doe@gmail.com&#8221;<br>        }<br>    }<br>}<\/p>\n\n\n\n<p>You can check your GraphQL query response by installing the Chrome extension&nbsp;<a href=\"https:\/\/chromewebstore.google.com\/detail\/altair-graphql-client\/flnheeellpciglgpaodhkhmapeljopja\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Altair GraphQl.<\/strong><\/a><\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"995\" height=\"375\" data-id=\"515613\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp\" alt=\"Altair Chrome Extention API\" class=\"wp-image-515613\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp 995w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api-300x113.webp 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api-250x94.webp 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api-768x289.webp 768w\" sizes=\"(max-width: 995px) 100vw, 995px\" loading=\"lazy\" \/><\/figure>\n<\/figure>\n\n\n\n<p>To check your query, first you have to set the endpoint.<\/p>\n\n\n\n<p>&lt;magento root url&gt;\/graphql<\/p>\n\n\n\n<p>Magento uses the GraphQL module to manage all predefined or custom GraphQL queries.<\/p>\n\n\n\n<p>After setting your endpoint,  you can see your custom query under the section of document explorer.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h1>\n\n\n\n<p>In this blog, we covered:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>What GraphQL is and why it&#8217;s better than REST<\/li>\n\n\n\n<li>How Magento 2 uses GraphQL<\/li>\n\n\n\n<li>How to create a custom GraphQL module<\/li>\n\n\n\n<li>How to build a query to get logged-in customer data<\/li>\n\n\n\n<li>How to secure GraphQL queries using <code>graphql.xml<\/code><\/li>\n<\/ul>\n\n\n\n<p>This is a common real-world requirement for headless Magento builds, React\/Vue storefronts, mobile apps, and PWAs.<\/p>\n\n\n\n<p>Mean, please try the above example, and if you have any queries, then please feel free to put them in the comment section.<\/p>\n\n\n\n<p>Note :- GraphQL included in <a href=\"https:\/\/github.com\/magento-engcom\/php-7.2-support\">Magento 2.3.0<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Modern eCommerce applications demand fast, flexible, and efficient data retrieval\u2014especially for headless storefronts, mobile apps, and PWAs. This is where GraphQL comes into play. What Is GraphQL? (Simple &amp; Clear Explanation) GraphQL is a modern query language for APIs created by Facebook. Unlike REST APIs\u2014where you often fetch too much or too little data\u2014GraphQL allows <a href=\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":115,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[7089,7090],"class_list":["post-133594","post","type-post","status-publish","format-standard","hentry","category-magento2","tag-how-to-use-graphql-in-magento2","tag-what-is-graphql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GraphQl implementation in magento2<\/title>\n<meta name=\"description\" content=\"GraphQL is a query language for Application Programming Interface (API) and a runtime for fulfilling those queries with your existing data.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GraphQl implementation in magento2\" \/>\n<meta property=\"og:description\" content=\"GraphQL is a query language for Application Programming Interface (API) and a runtime for fulfilling those queries with your existing data.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-16T05:47:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-30T10:52:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp\" \/>\n<meta name=\"author\" content=\"Shubham Sharma\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Shubham Sharma\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/\"},\"author\":{\"name\":\"Shubham Sharma\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/ae41bc19a6783d2f09c6b9b3a0fbddfd\"},\"headline\":\"How to Implement GraphQL in Magento 2\",\"datePublished\":\"2018-07-16T05:47:15+00:00\",\"dateModified\":\"2025-12-30T10:52:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/\"},\"wordCount\":479,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp\",\"keywords\":[\"How to use GraphQl in magento2\",\"what is GraphQl\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/\",\"url\":\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/\",\"name\":\"GraphQl implementation in magento2\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp\",\"datePublished\":\"2018-07-16T05:47:15+00:00\",\"dateModified\":\"2025-12-30T10:52:15+00:00\",\"description\":\"GraphQL is a query language for Application Programming Interface (API) and a runtime for fulfilling those queries with your existing data.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp\",\"width\":995,\"height\":375},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Implement GraphQL in Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/ae41bc19a6783d2f09c6b9b3a0fbddfd\",\"name\":\"Shubham Sharma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cdf13545eee5ced4cecd7bd6cb94c1d842ec000d359f91dd900e0feec6242c3b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cdf13545eee5ced4cecd7bd6cb94c1d842ec000d359f91dd900e0feec6242c3b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Shubham Sharma\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/shubham-sharma967\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GraphQl implementation in magento2","description":"GraphQL is a query language for Application Programming Interface (API) and a runtime for fulfilling those queries with your existing data.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/","og_locale":"en_US","og_type":"article","og_title":"GraphQl implementation in magento2","og_description":"GraphQL is a query language for Application Programming Interface (API) and a runtime for fulfilling those queries with your existing data.","og_url":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2018-07-16T05:47:15+00:00","article_modified_time":"2025-12-30T10:52:15+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp","type":"","width":"","height":""}],"author":"Shubham Sharma","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Shubham Sharma","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/"},"author":{"name":"Shubham Sharma","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/ae41bc19a6783d2f09c6b9b3a0fbddfd"},"headline":"How to Implement GraphQL in Magento 2","datePublished":"2018-07-16T05:47:15+00:00","dateModified":"2025-12-30T10:52:15+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/"},"wordCount":479,"commentCount":4,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp","keywords":["How to use GraphQl in magento2","what is GraphQl"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/","url":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/","name":"GraphQl implementation in magento2","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp","datePublished":"2018-07-16T05:47:15+00:00","dateModified":"2025-12-30T10:52:15+00:00","description":"GraphQL is a query language for Application Programming Interface (API) and a runtime for fulfilling those queries with your existing data.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/altair-chrome-extention-api.webp","width":995,"height":375},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/graphql-implementation-in-magento2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Implement GraphQL in Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/ae41bc19a6783d2f09c6b9b3a0fbddfd","name":"Shubham Sharma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cdf13545eee5ced4cecd7bd6cb94c1d842ec000d359f91dd900e0feec6242c3b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cdf13545eee5ced4cecd7bd6cb94c1d842ec000d359f91dd900e0feec6242c3b?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Shubham Sharma"},"url":"https:\/\/webkul.com\/blog\/author\/shubham-sharma967\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/133594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=133594"}],"version-history":[{"count":20,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/133594\/revisions"}],"predecessor-version":[{"id":519361,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/133594\/revisions\/519361"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=133594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=133594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=133594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}