将FirebaseRecaptchaVerifierModal传递到GraphQL
我有一个本地应用程序(expo)。我使用他们的FirebaseRecaptchaVerifierModal对用户进行身份验证。但是,我还计划在Firebase中设置自定义声明,因此我希望在GraphQL上执行身份验证和所有操作。 我设置了一个graphQL,并从前端接收数据(react native)。所以请假设我能够传递数据 我目前认为:将FirebaseRecaptchaVerifierModal传递到GraphQL,firebase,graphql,expo,Firebase,Graphql,Expo,我有一个本地应用程序(expo)。我使用他们的FirebaseRecaptchaVerifierModal对用户进行身份验证。但是,我还计划在Firebase中设置自定义声明,因此我希望在GraphQL上执行身份验证和所有操作。 我设置了一个graphQL,并从前端接收数据(react native)。所以请假设我能够传递数据 我目前认为: ... <FirebaseRecaptchaVerifierModal ref={recaptchaVerifier} firebaseConfig=
...
<FirebaseRecaptchaVerifierModal ref={recaptchaVerifier} firebaseConfig={firebaseConfig} />
...
<Button
title="Continue"
onPress={async () => {
// This will work, but I don't want to do it on React Native
// const phoneProvider = new firebase.auth.PhoneAuthProvider();
// const verificationId = await phoneProvider.verifyPhoneNumber(
// '+1' + phoneNumber,
// recaptchaVerifier.current
//);
// This will send the data to a method that will send the data to the graphQL:
const verificationId = await verifyPhoneNumber({
phoneNumber,
recaptchaVerifier: recaptchaVerifier.current,
});
navigation.navigate('CodeVerification', {
verificationId,
});
...
。。。
...
{
//这会有用的,但我不想在我的电脑上做
//const phoneProvider=new firebase.auth.PhoneAuthProvider();
//const verificationId=等待电话提供商。verifyPhoneNumber(
//“+1”+电话号码,
//海流
//);
//这会将数据发送到将数据发送到graphQL的方法:
const verificationId=等待verifyPhoneNumber({
电话号码,
recaptchaVerifier:recaptchaVerifier.current,
});
navigation.navigate('CodeVerification'{
验证ID,
});
...
我的问题是,应该作为对象传递的recaptchaVerifier.current
作为一个无意义的字符串传递“[对象,对象]”
在我的GraphQL中,我以字符串的形式传递数据。我真的不知道如何传递如此复杂的对象。我不认为在模式中键入每个对象字段和类型是合理的。所以我想我会将其字符串化并解析
我做得对吗?我应该做点别的吗