小编Sac*_*tus的帖子

graphqlHTTP 不是函数

这是我的简单 graphql express 应用程序

const express = require('express');
const graphqlHTTP = require('express-graphql');

const app = express();
app.use(
    '/graphql',
    graphqlHTTP({
      graphiql: true,
    })
  );

app.listen(4000, () => {
    console.log("listening for request!");
});
Run Code Online (Sandbox Code Playgroud)

我在运行时遇到以下错误:

 graphqlHTTP({
    ^

TypeError: graphqlHTTP is not a function
    at Object.<anonymous> (D:\PersonalProjects\GraphQL\server\app.js:7:5)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)  
    at internal/main/run_main_module.js:17:47
Run Code Online (Sandbox Code Playgroud)

我该如何解决?提前致谢!

javascript node.js express graphql express-graphql

48
推荐指数
5
解决办法
2万
查看次数

NextJs - 滚动到同一页面中的某个部分的链接

我正在使用 NextJs。我想在我的标题部分创建一个链接。此链接应通过滚动将用户带到同一页面上的 TestimonialsSection。

        <Link href={"#TestimonialsSection"}>
          <a className={styles.Designation}>Mentor</a>
        </Link>
Run Code Online (Sandbox Code Playgroud)

这是我尝试过的代码,但没有成功。但 URL 发生了变化。提前致谢

reactjs next.js

32
推荐指数
2
解决办法
7万
查看次数

如何将 serverless.yml 文件拆分为多个文件?

我正在为我的 AWS 支持的应用程序使用无服务器框架。serverless.yml到目前为止,我一直在编写一个超长文件,其中包含我所有的 lambda 代码、资源、IAM 角色和状态机。我发现管理这个大文件非常困难。我该如何解决这个问题?有什么方法可以将我的serverless.yml文件分割成更小的、可管理的块吗?yml如果我能每人得到一份就太好了lambda。提前致谢

lambda yaml amazon-web-services serverless-framework serverless

7
推荐指数
1
解决办法
5653
查看次数

来自 Root 账户的 Amazon LightSail 403 错误

我从 Amazon LightSail 收到 403 错误。我尝试过 Root 帐户和 IAM 帐户,但没有成功。 AWS LightSail 403 错误

可能是什么原因?

wordpress amazon-web-services http-status-code-403 amazon-iam amazon-lightsail

6
推荐指数
0
解决办法
787
查看次数

TokenRelayGatewayFilterFactory 上的 Spring Cloud Gateway 错误

运行 Spring Cloud Gateway 时出现以下错误。下面给出了对应的yml文件和我的依赖

    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-04-04 18:28:56.698 ERROR 6944 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method tokenRelayGatewayFilterFactory in org.springframework.cloud.security.oauth2.gateway.TokenRelayAutoConfiguration required a bean of type 'org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizedClientRepository' that could not be found.

The following candidates were found but could not be injected:
    - Bean method 'authorizedClientRepository' in 'ReactiveOAuth2ClientConfigurations.ReactiveOAuth2ClientConfiguration' not loaded because @ConditionalOnBean (types: org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository; SearchStrategy: all) did not find …
Run Code Online (Sandbox Code Playgroud)

spring spring-security oauth-2.0 microservices spring-cloud-gateway

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

在公共存储库上为 CircleCI 添加 Google-services.json 以发挥作用

我已将我的 Android 项目存储库链接到 CircleCI,当我构建时,出现 gradlew lint 错误,指出 google-services.json 不存在。有什么方法可以将 google-services.json 添加到我的项目中,而无需将其提交到存储库?

我正在使用 firebase 作为我项目的后端

android keystore firebase google-play-services circleci

3
推荐指数
1
解决办法
830
查看次数

使用 NextJs 获取滚动条位置

我使用 NextJs 来利用服务器端渲染。而且我的应用程序中有一个导航栏,它应该随滚动位置更改样式。如何在 NextJs 应用程序上检查窗口是否滚动超过 100 像素?

javascript scroll reactjs server-side-rendering next.js

3
推荐指数
1
解决办法
2万
查看次数

PyCuda mem_alloc 初始化错误

in desaturate_image
    redarray_gpu = cuda.mem_alloc(self.redarray.nbytes)
pycuda._driver.LogicError: cuMemAlloc failed: initialization error
Run Code Online (Sandbox Code Playgroud)

我在这一行收到上述错误:

redarray_gpu = cuda.mem_alloc(self.redarray.nbytes)
Run Code Online (Sandbox Code Playgroud)

可能是什么原因?

python arrays numpy pycharm pycuda

2
推荐指数
1
解决办法
1368
查看次数

JPA Hibernate 多对多 NestedServletException 问题

当我添加带有 id 的职位查询,将它们添加到 Employee 实体中设置的职位并保存 Employee 实体时,出现此错误

        2020-02-29 18:01:53.689  WARN 18280 --- [nio-8083-exec-2] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.StackOverflowError]
    2020-02-29 18:01:53.692  WARN 18280 --- [nio-8083-exec-2] o.h.e.loading.internal.LoadContexts      : HHH000100: Fail-safe cleanup (collections) : org.hibernate.engine.loading.internal.CollectionLoadContext@52efd6dc<rs=HikariProxyResultSet@690866176 wrapping Result set representing update count of 2>
    2020-02-29 18:01:53.692  WARN 18280 --- [nio-8083-exec-2] o.h.e.loading.internal.LoadContexts      : HHH000100: Fail-safe cleanup (collections) : org.hibernate.engine.loading.internal.CollectionLoadContext@4d7d18da<rs=HikariProxyResultSet@2035306242 wrapping Result set representing update count of -1>....
    .....
Run Code Online (Sandbox Code Playgroud)

员工实体

@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.DETACH, CascadeType.REFRESH}, fetch = FetchType.LAZY)
@Fetch(value= …
Run Code Online (Sandbox Code Playgroud)

mysql spring hibernate jpa one-to-one

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