GraphQL: build query arguments from object
问题 If I have an object: {"where":{"publishedAt_lt":"2018-01-01"}} How can I convert it to a string suitable for query arguments? articles(where: {publishedAt_lt: "2018-01-01"}) 回答1: This looks like an interesting library, I would suggest checking it out: https://www.npmjs.com/package/json-to-graphql-query But basically all we need to do is to convert the object to a string while ensuring the keys do not adopt double quotes and integers are not converted into strings, as that might not play well