小编RHa*_*uck的帖子

在nestJs中可以一起使用控制器和graphql解析器吗?

对于我的下一个项目,我想在前端使用 Graphql。此外,这个项目还应该提供一个 Rest-Api。现在我发现了这个非常伟大的框架“nestjs”,理论上可以将 Graphql 端点和 Rest 端点结合起来。不幸的是,如果这会导致问题,我在文档中找不到任何内容。下面的代码可以正常使用吗?

阿蒂克尔控制器:

@Controller('article')
@Resolver('Article')
export class ArticleController {
    constructor(private articleService: ArticleService){}

    @Get()
    @Query(returns => CArticle)
    async Article() {
     const dbElement=await this.articleService.getById("xy");
     return dbElement;
    }
}
Run Code Online (Sandbox Code Playgroud)

文章模块:

@Module({
    controllers:[ArticleController],
    providers:[ArticleService,ArticleController]
})
export class ArticleModule {}
Run Code Online (Sandbox Code Playgroud)

nestjs

9
推荐指数
1
解决办法
3856
查看次数

有时,不会通过 Facebook 登录在 cognito 上创建用户

在我的反应原生应用程序中,我为用户提供了使用 Facebook 按钮登录的可能性。为此,我使用 Amplify,它在 Cognito 中应该在用户池中创建一个用户。这也有效,但由于某种原因它并不总是有效。我也无法解释它,因为我不使用可能包含我的网站错误的触发器。大约 40% 的情况下无法登录。以下操作会导致错误:

  1. 用户点击 Facebook 按钮
  2. 用户将被转发到 Facebook
  3. 用户登录 Facebook
  4. 用户将被转发回反应本机应用程序。

结果:现在用户池中没有创建用户,并且react-native应用程序中出现以下错误(通过Hub.listen("auth")

{"event":"signIn_failure","data":{},"message":"The OAuth response flow failed"}
console.js:35
{"event":"signIn_failure","data":{},"message":"The OAuth response flow failed"}
console.js:35
{"event":"cognitoHostedUI_failure","data":{},"message":"A failure occurred when returning to the Cognito Hosted UI"}
console.js:35
{"event":"cognitoHostedUI_failure","data":{},"message":"A failure occurred when returning to the Cognito Hosted UI"}
console.js:35
{"event":"customState_failure","data":{},"message":"A failure occurred when returning state"}
console.js:35
{"event":"customState_failure","data":{},"message":"A failure occurred when returning state"}
Run Code Online (Sandbox Code Playgroud)

我的应用程序客户端设置如下所示:

应用程序客户端设置

amazon-cognito aws-amplify

5
推荐指数
0
解决办法
347
查看次数

标签 统计

amazon-cognito ×1

aws-amplify ×1

nestjs ×1