Skip to content

Commit

Permalink
Merge pull request #306 from NibiruChain/develop
Browse files Browse the repository at this point in the history
fix: fix
  • Loading branch information
cgilbe27 authored Feb 5, 2024
2 parents dcb37b4 + 1b6c027 commit 2edfa6a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
23 changes: 12 additions & 11 deletions src/gql/mutation/marketing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ export const marketingMutationString = (
excludeParentObject: boolean,
fields?: Partial<GQLTwitterUser>
) =>
`marketing {
${gqlQuery(
"updateTwitterUser",
args,
fields
? convertObjectToPropertiesString(fields)
: convertObjectToPropertiesString(defaultTwitterUser),
excludeParentObject,
true
)}
`mutation {
marketing {
${gqlQuery(
"updateTwitterUser",
args,
fields
? convertObjectToPropertiesString(fields)
: convertObjectToPropertiesString(defaultTwitterUser),
excludeParentObject
)}
}
}`

export const marketingMutation = async (
Expand All @@ -40,7 +41,7 @@ export const marketingMutation = async (
fields?: Partial<GQLTwitterUser>
): Promise<GqlOutMarketingMutation> =>
doGqlQuery(
marketingMutationString(args, false, fields),
marketingMutationString(args, true, fields),
endpt,
authorizationHeader,
true
Expand Down
5 changes: 2 additions & 3 deletions src/gql/utils/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ export const gqlQuery = <T>(
name: string,
typedQueryArgs: IterableDictionary<T>,
properties: string,
excludeParentObject?: boolean,
isMutation?: boolean
excludeParentObject?: boolean
) => {
const queryArgList = []

Expand All @@ -122,7 +121,7 @@ export const gqlQuery = <T>(

const hasQueryList = (char: string) => (queryArgList.length > 0 ? char : "")

return `${isMutation ? "mutation " : " "}${excludeParentObject ? "" : "{"}
return `${excludeParentObject ? "" : "{"}
${name} ${hasQueryList("(")}${queryArgList.join(", ")}${hasQueryList(")")} {
${properties}
}
Expand Down

1 comment on commit 2edfa6a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines Statements Branches Functions
Coverage: 93%
94.62% (1197/1265) 87.7% (542/618) 88.03% (309/351)

Please sign in to comment.