
CSS text-wrap: balance vs. text-wrap: prettyCompare and contrast two CSS components, text-wrap: balance and text-wrap: pretty, and discuss their benefits for better UX.

Remix 3 ditches React for a Preact fork and a “Web-First” model. Here’s what it means for React developers — and why it’s controversial.

A quick guide to agentic AI. Compare Autogen and Crew AI to build autonomous, tool-using multi-agent systems.

Compare the top AI development tools and models of November 2025. View updated rankings, feature breakdowns, and find the best fit for you.
Would you be interested in joining LogRocket's developer community?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now
3 Replies to "GraphQL variables in simple terms"
Testing variables in some application is pretty straightforward. However, how do you use variables in a standard fetch call using code?
In the body of the request stringify your graphql query like this:- hope it helps
fetch(‘https://api.hashnode.com’, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’,
Authorization: ”,
},
body: JSON.stringify({
query:
‘mutation createStory($input: CreateStoryInput!){ createStory(input: $input){ code success message } }’,
variables: {
input: {
title: ‘What are the e2e testing libraries you use ?’,
contentMarkdown: ‘# You can put Markdown here.\n***\n’,
tags: [
{
_id: ‘56744723958ef13879b9549b’,
slug: ‘testing’,
name: ‘Testing’,
},
],
coverImageURL:
‘https://codybontecou.com/images/header-meta-component.png’,
},
},
}),
})
.then(res => res.json())
.then(res => console.log(JSON.stringify(res)))
Thank you! After endless hours trying to use string interpolation to inject my $token into the GraphQL request and having to deal with needing to escape quotation mark characters, this helped me correctly use variables for my request.