convert-to-graphql-string
v1.0.0
Published
A utility to convert JS objects into GraphQL-compatible string representations.
Downloads
71
Maintainers
Readme
convert-to-graphql-string
A utility to convert JavaScript objects into GraphQL-compatible string representations.
Installation
npm install convert-to-graphql-string
Usage
import convertToGraphQLString from 'convert-to-graphql-string';
const obj = {
name: "John",
age: 30,
hobbies: ["reading", "sports"]
};
const gqlString = convertToGraphQLString(obj);
console.log(gqlString);
// Output: { name: "John", age: 30, hobbies: ["reading", "sports"] }