Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
linchen1987 committed Sep 26, 2023
1 parent de6c00a commit 01bc70b
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions packages/sdk-util/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,11 @@ const makeQuery = (fields, ignoreFields, argValues = {}) => `
.map(x => {
const subQueryStr = `${x.name} {
__typename
${x.possibleTypes
.filter(t => !ignoreFields.includes(t.name))
.map(
t => `... on ${t.name} {
${x.possibleTypes.filter(t => !ignoreFields.includes(t.name)).map(
t => `... on ${t.name} {
${makeQuery(t.fields, ignoreFields, argValues).trim()}
}`
)}
)}
}`;
return subQueryStr;
Expand Down Expand Up @@ -194,12 +192,10 @@ const formatArgs = (values, specs = {}) => {
if ('String' === type) {
const container = isNull(value) ? null : String(value).includes('\n') ? '"""' : '"';

return isNull(value)
? null
: `${container}${value
.toString()
.replace(/\\/g, '\\\\')
.replace(/"/g, '\\"')}${container}`;
return isNull(value) ? null : `${container}${value
.toString()
.replace(/\\/g, '\\\\')
.replace(/"/g, '\\"')}${container}`;
}

if (['DateTime', 'ID', 'HexString'].includes(type)) {
Expand Down

0 comments on commit 01bc70b

Please sign in to comment.