File tree Expand file tree Collapse file tree 4 files changed +8
-14
lines changed Expand file tree Collapse file tree 4 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ const AtlasProvider: React.FC<{ children?: React.ReactNode }> = ({ children }) =
103103 queryFn : async ( ) => {
104104 try {
105105 if ( ! isVerified || isUndefined ( address ) ) return undefined ;
106- return await fetchUser ( atlasGqlClient , address ) ;
106+ return await fetchUser ( atlasGqlClient ) ;
107107 } catch {
108108 return undefined ;
109109 }
@@ -159,7 +159,7 @@ const AtlasProvider: React.FC<{ children?: React.ReactNode }> = ({ children }) =
159159 if ( ! address || ! isVerified ) return false ;
160160 setIsAddingUser ( true ) ;
161161
162- const userAdded = await addUserToAtlas ( atlasGqlClient , { address , ... userSettings } ) ;
162+ const userAdded = await addUserToAtlas ( atlasGqlClient , userSettings ) ;
163163 refetchUser ( ) ;
164164
165165 return userAdded ;
Original file line number Diff line number Diff line change 11import { gql , type GraphQLClient } from "graphql-request" ;
22import { toast } from "react-toastify" ;
3- import { Address } from "viem" ;
43
54import { OPTIONS } from "utils/wrapWithToast" ;
65
@@ -11,7 +10,6 @@ const query = gql`
1110` ;
1211
1312export type AddUserData = {
14- address ?: Address ;
1513 email : string ;
1614} ;
1715
Original file line number Diff line number Diff line change @@ -14,25 +14,21 @@ export type User = {
1414} ;
1515
1616const query = gql `
17- query GetUser($address: String!) {
18- user(address: $address) {
17+ query GetUser {
18+ user {
1919 email
2020 }
2121 }
2222` ;
2323
24- export function fetchUser ( client : GraphQLClient , address : string ) : Promise < User > {
25- const variables = {
26- address,
27- } ;
28-
24+ export function fetchUser ( client : GraphQLClient ) : Promise < User > {
2925 return toast . promise < User , Error > (
3026 client
31- . request < GetUserResponse > ( query , variables )
27+ . request < GetUserResponse > ( query )
3228 . then ( ( response ) => response . user )
3329 . catch ( ( errors ) => {
3430 // eslint-disable-next-line no-console
35- console . log ( "Error fetching user :" , address , { errors } ) ;
31+ console . log ( "Error fetching user :" , { errors } ) ;
3632 const errorMessage = Array . isArray ( errors ?. response ?. errors )
3733 ? errors . response . errors [ 0 ] ?. message
3834 : "Error user nonce" ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { toast } from "react-toastify";
44import { OPTIONS } from "utils/wrapWithToast" ;
55
66const query = gql `
7- mutation UpdateUser($settings: UpdateUserDto !) {
7+ mutation UpdateUser($settings: UpdateUserSettingsDto !) {
88 updateUser(updateUserSettings: $settings)
99 }
1010` ;
You can’t perform that action at this time.
0 commit comments