expo / snack

Expo Snack lets you run Expo in the browser.
https://snack.expo.dev
MIT License
356 stars 104 forks source link

feature(website): Update AuthenticationManager to get user data from the GraphQL API #453

Closed gabrieldonadel closed 1 year ago

gabrieldonadel commented 1 year ago

Why

In order to support fetching more complex data involving user fields, we should use the GraphQL API instead of api/v2. Necessary for querying things like:

{
  me {
    id
    username 
    userExperiments {
      id
      enabled
      experiment
    }
  }
}

In a follow-up PR we should add something like graphql-tag to have more robust support for the GraphQL queries

How

Replace the existing userInfo request with an equivalent query using the GraphQL API

Test Plan

Run the website locally and ensure user data is loaded correctly

image
gabrieldonadel commented 1 year ago

Did you check if the other properties aren't used anywhere?

Yes, the only properties used were id, username and picture