Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add superprofile integration with fauna #94

Merged
merged 7 commits into from
May 6, 2022
Merged

Conversation

RonLek
Copy link
Collaborator

@RonLek RonLek commented Mar 20, 2022

Add

  • Mutation API to upsert users to Fauna on user login/signup
  • MVP superprofile UI

Reference

  • GraphQL schema can be found within assets/rc4community-schema.graphql.

Functions

Fauna UpsertUser function

Query(
  Lambda(
    ["uid", "email", "displayName", "phoneNumber", "photoURL"],
    Let(
      {
        user: Match(Index("getByEmail"), Var("email")),
        upsert: If(
          Exists(Var("user")),
          Update(Select(["ref"], Get(Var("user"))), {
            data: {
              displayName: Var("displayName"),
              phoneNumber: Var("phoneNumber"),
              photoURL: Var("photoURL")
            }
          }),
          Create(Collection("User"), {
            data: {
              uid: Var("uid"),
              email: Var("email"),
              displayName: Var("displayName"),
              phoneNumber: Var("phoneNumber"),
              photoURL: Var("photoURL")
            }
          })
        )
      },
      Var("upsert")
    )
  )
)

Roles

FrontEndRole

UpsertUserUDF

@lgtm-com
Copy link

lgtm-com bot commented Mar 20, 2022

This pull request introduces 2 alerts when merging 4289fe1 into 2a31cab - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

@RonLek RonLek requested a review from Sing-Li March 20, 2022 07:58
@Sing-Li
Copy link
Member

Sing-Li commented Mar 26, 2022

@RonLek are you going to add the "simplified key-value abstraction version" on this PR? Or elsewhere? Thanks.

@RonLek
Copy link
Collaborator Author

RonLek commented Mar 27, 2022

@Sing-Li will be adding the abstracted version here itself. Working on this.

@debdutdeb debdutdeb closed this Apr 3, 2022
@debdutdeb debdutdeb reopened this Apr 3, 2022
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ RonLek
❌ Rohan Lekhwani


Rohan Lekhwani seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@lgtm-com
Copy link

lgtm-com bot commented May 6, 2022

This pull request introduces 2 alerts when merging 6705db9 into df318b4 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented May 6, 2022

This pull request introduces 2 alerts when merging 08873d4 into df318b4 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

@RonLek RonLek merged commit 1612542 into master May 6, 2022
@RonLek
Copy link
Collaborator Author

RonLek commented May 6, 2022

Merging to unblock @Dnouv . Will push the abstracted version on a separate branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants