Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

GraphQL is a data query and manipulation language that allows specifying what data is to be retrieved or modified.

Step 1: Create a Simple GraphQL API:
First, make sure you have Node.js installed. Then, in your project folder, create a new Node.js project and install the necessary packages.

mkdir graphql-whoami
cd graphql-whoami
npm init -y
npm install apollo-server graphql

Step 2: Create the GraphQL Server
create a file called 'index.js' in the project folder

Step 3: Run the GraphQL Server
node index.js     //Run the server in Terminal

Then server should be running at http://localhost:4000

Test this API using POSTMAN tool
Make a POST method in Postman tool,
URL: http://localhost:4000/
Method: POST
Body:
{
  "query": "{ hello name age work designation }"
}