metaData is empty even if _data does have the data

Hi Everybody,

I am trying to get some data when i login with facebook. But for some reason i get that the url is null which is strange because when i debug i see the picture url clearly.

I did use custom jwt for google auth and with that, it works fine.

the code:

class RealmService with ChangeNotifier {
  final String appId = "xxx";
  late final appConfig = AppConfiguration(appId);
  late final _app = App(appConfig);

  late final user = _app.currentUser;
  late realmModel.User? currentUser;
  static final RealmService _singleton = RealmService._internal();
 factory RealmService() {
    return _singleton;

Future<userModel.User> loginWithFacebook() async {
    final LoginResult result = await FacebookAuth.instance.login();

    final AccessToken accessToken = result.accessToken!;
    final credentials = Credentials.facebook(accessToken.token);
    final user = await _app.logIn(credentials);

    currentUser = user;

    final AuthLink authLink = AuthLink(
      getToken: () async {
        return 'Bearer ${accessToken.token}';

    final Link link = authLink.concat(ApiConstants.httpLink);

    final GraphQLClient client = GraphQLClient(
      link: link,
      cache: GraphQLCache(),

    final MutationOptions options = MutationOptions(
      document: gql('''
    mutation Login(\$displayName: String!, \$email: String!, \$photoUrl: String!, \$userId: String!, \$isActive: Boolean!) {
      login(displayName: \$displayName, email: \$email, photoUrl: \$photoUrl, userId: \$userId, isActive: \$isActive) {
      variables: <String, dynamic>{
        'displayName': ?? 'Unknown',
        // 'photoUrl': user.profile.pictureUrl!,
        'isActive': true

    final QueryResult result2 = await client.mutate(options);

    if (result2.hasException) {
      throw Exception('Error logging in: ${result2.exception}');
    await currentUser!.refreshCustomData(); // Refresh the custom data
    final data =!['login'];

    user2 = userModel.User.fromJson(data);

    final storage = FlutterSecureStorage();
    // await storage.write(key: 'jwtToken', value: ggAuth.idToken!);
    _token = _app.currentUser!.accessToken;

    final customUserData = user.customData; // Access the custom data
    await currentUser!.refreshCustomData(); // Refresh the custom data

    return user2;


anyone any idea why this is the case?