Skip to content

Commit

Permalink
FIx for profile updating
Browse files Browse the repository at this point in the history
  • Loading branch information
edlouth committed Nov 10, 2023
1 parent 9f1e533 commit 90d8099
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 133 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion grai-frontend/src/components/auth/login/LoginForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test("submit", async () => {
username: "",
first_name: "",
last_name: "",
__typename: "User",
__typename: "Profile",
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions grai-frontend/src/components/auth/login/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import useAuth from "../useAuth"
export const LOGIN = gql`
mutation Login($username: String!, $password: String!) {
login(username: $username, password: $password) {
... on User {
... on Profile {
id
username
first_name
Expand Down Expand Up @@ -61,7 +61,7 @@ const LoginForm: React.FC<LoginFormProps> = ({ onDeviceRequest }) => {
.then(res => {
if (!res) return

if (res.__typename === "User") {
if (res.__typename === "Profile") {
posthog.identify(res.id, { email: res.username })
hubspot.push(["identify", { email: res.username }])
setLoggedIn(true)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion grai-frontend/src/pages/auth/__generated__/Verify.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

117 changes: 10 additions & 107 deletions grai-frontend/src/testing/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -9225,7 +9225,7 @@
"name": null,
"ofType": {
"kind": "UNION",
"name": "UserDeviceDataWrapper",
"name": "ProfileDeviceDataWrapper",
"ofType": null
}
},
Expand Down Expand Up @@ -9298,7 +9298,7 @@
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "User",
"name": "Profile",
"ofType": null
}
},
Expand Down Expand Up @@ -9373,7 +9373,7 @@
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "User",
"name": "Profile",
"ofType": null
}
},
Expand Down Expand Up @@ -9418,7 +9418,7 @@
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "User",
"name": "Profile",
"ofType": null
}
},
Expand Down Expand Up @@ -9463,7 +9463,7 @@
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "User",
"name": "Profile",
"ofType": null
}
},
Expand Down Expand Up @@ -9553,7 +9553,7 @@
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "User",
"name": "Profile",
"ofType": null
}
},
Expand Down Expand Up @@ -9640,7 +9640,7 @@
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "User",
"name": "Profile",
"ofType": null
}
},
Expand Down Expand Up @@ -9685,7 +9685,7 @@
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "User",
"name": "Profile",
"ofType": null
}
},
Expand Down Expand Up @@ -11243,68 +11243,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "fetchOrCreateChats",
"description": null,
"args": [
{
"name": "workspaceId",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null
}
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "ChatDataWrapper",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "fetchOrCreateChat",
"description": null,
"args": [
{
"name": "workspaceId",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"defaultValue": null
}
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Chat",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "createChat",
"description": null,
Expand Down Expand Up @@ -11344,7 +11282,7 @@
},
{
"kind": "UNION",
"name": "UserDeviceDataWrapper",
"name": "ProfileDeviceDataWrapper",
"description": null,
"fields": null,
"inputFields": null,
Expand All @@ -11353,7 +11291,7 @@
"possibleTypes": [
{
"kind": "OBJECT",
"name": "User",
"name": "Profile",
"ofType": null
},
{
Expand Down Expand Up @@ -11502,41 +11440,6 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "ChatDataWrapper",
"description": null,
"fields": [
{
"name": "data",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Chat",
"ofType": null
}
}
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "__Schema",
Expand Down
Loading

0 comments on commit 90d8099

Please sign in to comment.