How to make Graphql request using fetch API?

When working with Graphql you want to make graphql requests for queries and mutations. If you're not using some client-side javascript libraries for handling Graphql requests then using fetch is an easy solution.

Muthukumar

Feb 26, 2022

More stories

How to start PostgreSQL database using Docker?

Quickly spin up a PostgreSQL database using docker.

Feb 25, 2022

How to find an element in an array in Javascript?

If you know how to find an element from an array in other languages like python or java, you may think of using the same method to find an element in the array. But there is an easy and default way to find an element in an array in Javascript.

Jan 30, 2022

How to fix git not ignoring files or folder that is just added to the .gitignore file?

If a file is already tracked by git and if you try to remove it by adding it to the .gitignore file, it may sometimes not ignore the file properly.

Jan 17, 2022

What is a closure in javascript?

When a function is enclosed within another function and the enclosed function has access to the variable in the surrounding environment. That is, the variables of the enclosing function, then are called closure.

Dec 27, 2021

How to use Array map method in Javascript

Array.prototype.map() method iterates over the given array and returns a new value for each item in the array.

Oct 20, 2021

Why you should avoid magic numbers in code?

Magic numbers are numbers in code that don't have any meaning to them. So it is always a good practice to assign the number to a variable and name the variable corresponding to its value.

Aug 15, 2021

How to eliminate multiple If checks?

It is tedious to return a value based on a key when using multiple If checks. If the new value is added we need to add one more If check for that value. The simple solution is we can use the Config object to the pattern to eliminate this problem.

Aug 11, 2021

Misconceptions and things you need to know before buying a domain name

There are several misconceptions and things you need to know before buying a domain

Apr 11, 2021

List of cool things I found in the week of March 28, 2021

When I come across or when searching for something sometimes it feels so cool. So I want to share that with others too. So these are the list of cool things I found in the week of March 28, 2021

Mar 28, 2021

List of cool things I found in the week of March 14, 2021

When I come across or when searching for something sometimes it feels so cool. So I want to share that with others too. So these are the list of cool things I found in the week of March 14, 2021

Mar 14, 2021

How to prevent the Heroku app from idling after 30 minutes?. And keep the app active.

Free tier Heroku apps will go to idle after 30 minutes of no traffic and there are ways to prevent that from happening.

Mar 06, 2021

Here is the reason why I love Vim text editor

I have been using Vim for past almost 2 years and here are my thoughts, how I got introduced to Vim text editor, and why I love Vim.

Dec 12, 2020

My bookmarks and links

My bookmarks, links, and list of tools links I collected over the years are listed in this post.

Nov 25, 2020

What is Unit testing and Mock testing?

Beginner's introduction to Unit and Mock testing.

Aug 24, 2020