Open inoublileith opened 1 year ago
the problem is specifically related to user registration using GraphQL on the Supabase platform, and i am seeking help to resolve it This is the function I use
Future<void> registerEmployee( String email, String password, BuildContext context) async { try { setIsLoading = true; if (email.isEmpty || password.isEmpty) { throw 'All Fields are required'; } const String registrationMutation = r''' mutation Register($email: String!, $password: String!) { insert_auth_users(email: $email, password: $password) { Users { id email } } } '''; final MutationOptions registrationOptions = MutationOptions( document: gql(registrationMutation), variables: <String, dynamic>{ 'email': email, 'password': password, }, ); final QueryResult registrationResult = await _graphQLClient.mutate(registrationOptions); if (registrationResult.hasException) { throw registrationResult.exception!; } final userData = registrationResult.data!['registerUser']['user']; final user = User.fromJson(userData); print("user : $user, userdata : $userData"); Utils.showSnackBar('Successfully registered!', context, color: Colors.green); setIsLoading = false; } catch (e) { setIsLoading = false; Utils.showSnackBar(e.toString(), context, color: Colors.red); } }
and this is the error
error :OperationException(linkException: null, graphqlErrors: [GraphQLError(message: Unknown field "insert_auth_users" on type Mutation, locations: null, path: null, extensions: null)])
the problem is specifically related to user registration using GraphQL on the Supabase platform, and i am seeking help to resolve it This is the function I use
and this is the error