Added notification generation on SMS. Added FCM Token saving on login.

This commit is contained in:
Patrick Fic
2020-05-01 12:32:40 -07:00
parent 92aeb419a9
commit 636e979fd0
21 changed files with 3810 additions and 45 deletions

View File

@@ -1,7 +1,7 @@
import { gql } from "apollo-boost";
export const UPSERT_USER = gql`
mutation upsert_user($authEmail: String!, $authToken: String!) {
mutation UPSERT_USER($authEmail: String!, $authToken: String!) {
insert_users(
objects: [{ email: $authEmail, authid: $authToken }]
on_conflict: { constraint: users_pkey, update_columns: [authid] }
@@ -12,3 +12,17 @@ export const UPSERT_USER = gql`
}
}
`;
export const UPDATE_FCM_TOKEN = gql`
mutation UPDATE_FCM_TOKEN($authEmail: String!, $token: jsonb!) {
update_users(
where: { email: { _eq: $authEmail } }
_append: { fcmtokens: $token }
) {
affected_rows
returning {
fcmtokens
}
}
}
`;