Skip to content

Commit d5e6b7d

Browse files
committed
Add a space between array items, as per object keys
1 parent 299c290 commit d5e6b7d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/__tests__/jsonToGraphQLQuery.tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe('jsonToGraphQL()', () => {
112112
};
113113
expect(jsonToGraphQLQuery(query, { pretty: true })).to.equal(
114114
`query {
115-
Posts (or: [{published: true},{rating: [{_gt: 3}]}], orderBy: "post_date") {
115+
Posts (or: [{published: true}, {rating: [{_gt: 3}]}], orderBy: "post_date") {
116116
id
117117
title
118118
post_date

src/jsonToGraphQLQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function stringify(obj_from_json: any): string {
66
return JSON.stringify(obj_from_json);
77
}
88
else if (Array.isArray(obj_from_json)) {
9-
return `[${obj_from_json.map((item) => stringify(item)).join(',')}]`;
9+
return `[${obj_from_json.map((item) => stringify(item)).join(', ')}]`;
1010
}
1111
// Implements recursive object serialization according to JSON spec
1212
// but without quotes around the keys.

0 commit comments

Comments
 (0)