@@ -12,10 +12,9 @@ import { Translation, useTranslation } from "react-i18next";
1212import { type FragmentType , graphql , useFragment } from "../../gql" ;
1313import { Close , Description , Dialog , Title } from "../Dialog" ;
1414import { Link } from "../Link" ;
15-
1615import { useMutation , useQueryClient } from "@tanstack/react-query" ;
17- import { graphqlClient } from "../../graphql" ;
1816import styles from "./UserEmail.module.css" ;
17+ import { graphqlRequest } from "../../graphql" ;
1918
2019// This component shows a single user email address, with controls to verify it,
2120// resend the verification email, remove it, and set it as the primary email address.
@@ -136,7 +135,7 @@ const UserEmail: React.FC<{
136135
137136 const setPrimary = useMutation ( {
138137 mutationFn : ( id : string ) =>
139- graphqlClient . request ( SET_PRIMARY_EMAIL_MUTATION , { id } ) ,
138+ graphqlRequest ( { query : SET_PRIMARY_EMAIL_MUTATION , variables : { id } } ) ,
140139 onSuccess : ( _data ) => {
141140 queryClient . invalidateQueries ( { queryKey : [ "currentUserGreeting" ] } ) ;
142141 queryClient . invalidateQueries ( { queryKey : [ "userEmails" ] } ) ;
@@ -145,7 +144,7 @@ const UserEmail: React.FC<{
145144
146145 const removeEmail = useMutation ( {
147146 mutationFn : ( id : string ) =>
148- graphqlClient . request ( REMOVE_EMAIL_MUTATION , { id } ) ,
147+ graphqlRequest ( { query : REMOVE_EMAIL_MUTATION , variables : { id } } ) ,
149148 onSuccess : ( _data ) => {
150149 onRemove ?.( ) ;
151150 queryClient . invalidateQueries ( { queryKey : [ "currentUserGreeting" ] } ) ;
0 commit comments