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

A lot of differences between user entity in ZenPub and Bonfire API #168

Open
oksanasalohubova opened this issue Feb 10, 2022 · 0 comments
Open
Labels
bonfire-migration Issues linked to ZenPub to Bonfire migration

Comments

@oksanasalohubova
Copy link
Collaborator

oksanasalohubova commented Feb 10, 2022

In order to create the functionality of the organization in the application, it is necessary for the objects to have the same structure or differ slightly.
Now I see a completely different structure about the User entity, of the Me entity and the Person entity

This is the structure of me entity in ZenPub:

query me {
  me{
    isInstanceAdmin
    email
    isConfirmed
    wantsEmailDigest
    wantsNotifications
    user {
      id
      name
      icon {
        id
        url
      }
      image {
        id
        url
      }
      location
      summary
      displayUsername
      website
      extraInfo
      preferredUsername
     .... // may be some other fields but in login function only this
  	}
  }
}

This is a structure of me entity in BonFire:

query me {
  me {
    accountId
    flagsForModeration {
      id
      object {
       ...
      }
      objectId
      subject
      subjectId
      verb
    }
    userFeed {
      id
      object
      objectId
      subject
      subjectId
      directReplies
    }
    followed {
      ...
    }
    followers {
      ...
    }
    likeActivities {
      ...
    }
    userNotifications{
      ...
    }
    user {
      id
      character {
        username
      }
      profile {
        summary
        name
      }
      userActivities {
        ....
      }
      boostActivities {
        
      }
      posts {
        id
        postContent {
          title
          htmlBody
        }
      }
    }
  }
}

These differences prevent existing application code from being adapted to this API in a quick and easy way.
There is not enough information both in the user object and in the Me object

It should also be taken into account that the primary file with query object Me calls contains the profile update and session exit functions that have the following form, and each time were imported usMe function it provide logout and updateProfile functions.

mutation meLogout {
  deleteSession
}
 mutation updateProfile(profile:$profile, icon: $icon, image: $image){
    user {
      ...SettingsPageMeUser
    }
  }

I can change mutation updateProfile to updateUser, but the properties is also different

@pral2a pral2a added the bonfire-migration Issues linked to ZenPub to Bonfire migration label Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bonfire-migration Issues linked to ZenPub to Bonfire migration
Projects
None yet
Development

No branches or pull requests

2 participants