Skip to content

Binstellar-Technologies/magento2-how-to-fetch-customer-custom-attribute-details-like-nationality-etc..-using-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magento2 How to fetch Customer custom attribute Details like nationality, marital_status etc... using GraphQL

GraphQL, a query language for the APIs.

   

GraphQL provides a complete and understandable description of the data in your API, it makes it easier to evolve APIs over time.

   

Here we have created a custom GraphQL module to get customer custom attribute values. There is always a need to add new customer attributes like Nationaity, Marital Status, Preferred Language, Highest Education etc..

   

Wondering how to achieve that? Don't worry we have got the solution for it.

Install our module Binstellar/MyAccount

   

In order to achieve this we have created a custom Resolver & added the functionality to get the customer added values via GRAPHQL end point.

   

Installation Steps

Step 1 : Download the Zip file from Github & Unzip it
Step 2 : Create a directory under app/code/Binstellar/MyAccount
Step 3 : Upload the files & folders from extracted package to app/code/Binstellar/MyAccount
Step 4 : Go to the Magento2 Root directory & run following commands

php bin/magento setup:upgrade

php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy -f

php bin/magento cache:flush

   

screenshot-nimbusweb me-2023 02 01-11_00_09

   

Note : We have tested this option in Magento ver. 2.4.5-p1