Skip to content

Commit db374cd

Browse files
committed
No need to stringify
1 parent d8388b6 commit db374cd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/workgrid-client/src/client.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -529,20 +529,22 @@ setTypedMutationDefaults('deleteNotification', (client) => ({
529529
}))
530530

531531
// graphql
532+
532533
// ================================================================================================================================
533534

534535
/** @beta */
535536
export interface Mutations {
536-
graphql: Mutation<['graphql'], { query: string; variables: unknown }>
537+
graphql: Mutation<['graphql'], { query: string; variables: unknown }, unknown>
537538
}
538539

539540
setTypedMutationDefaults('graphql', (client) => ({
540-
mutationFn: async (payload) => {
541-
const { query, variables } = payload
542-
const data = JSON.stringify({
541+
mutationFn: async (params) => {
542+
const { query, variables } = params
543+
544+
const data = {
543545
query,
544546
variables,
545-
})
547+
}
546548

547549
const response = await client.httpClient.post('graphql', data)
548550
return response.data.data /* unwrap jsend */

0 commit comments

Comments
 (0)