问题标签 [grandstack]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
108 浏览

neo4j - 大堆添加与关系的突变

我可以调用突变来插入一个节点,但是如果我也想插入与另一个节点的关系怎么办?

我看到 Grandstack 已经产生了这种类型的一些突变: AddGroupUsers

我如何用节点插入突变将此突变称为togeder?一种交易?可能吗?是否存在一种方法来定义与同一突变中的节点的关系?

0 投票
1 回答
532 浏览

reactjs - 执行多重依赖突变 - grandstack apollo graphql 3.3

我有点困惑如何在 graphql 中执行多重突变。

我已经阅读了有关使用graphql()函数或compose()函数的文章,但我不明白这些是传统的方法(版本 2)还是仍然是一种有效的方法。

我目前正在使用带有 grandstack 的 apollo 3.3,在我的组件中我执行以下操作来执行突变(我使用useMutation()了由提供的钩子ApolloClient

如您所见,我没有使用诸如<Query>, 之类的组件..

第一个问题:这个组件与 apollo 旧版本有关吗?仍然经常使用还是useMutation()钩子是阿波罗 3 的首选?

第二个问题:我需要执行与第一个突变相关的第二个突变,并且我需要从第一个突变生成的 id 来执行第二个突变

此外,应根据值/变量/其他内容有条件地执行第二次突变

0 投票
1 回答
157 浏览

javascript - 在 GrandStack 中设置关系类型

我正在尝试在 Grandstack 中设置关系类型。我在让事情正常运行时遇到问题。即使我将指南复制到我的项目中并尝试运行它......事情也不起作用。这是他们在https://grandstack.io/docs/guide-graphql-schema-design的内容

问题是当我运行它时,我收到以下错误:

不知道为什么它认为用户字段没有定义。这是我的 server.js 文件

0 投票
1 回答
49 浏览

graphql - AND 没有在 GraphQL 中返回结果

我正在尝试使用 AND 运算符编写查询以从 GraphQL 中的 neo4j 中提取数据,但它不返回任何结果。我正在使用 neo4j-graphql-js 库。我有以下架构

以下是查询:

我也试过这个:

但是这两个查询不返回任何结果。如果我只写label: "fruits"而没有 AND 它会返回结果,但我想要所有特别适合香蕉的水果订单。有什么建议我哪里出错了吗?

0 投票
0 回答
96 浏览

neo4j - GraphQL Mutation:如何在 Neo4j 节点属性中添加当前时间?

我的 GraphQL 架构中有一个类型,如下所示:

由于 GraphQL 的突变,我想向将在 Neo4j 中创建的节点添加一个属性。

我尝试这样做以在调用突变时在节点中创建当前时间:

在创建的节点中,我使用当前日期创建了属性日期,但是有这个:

我不明白为什么我在 06 之后只有零。

当我执行突变请求时,如何获得当前的确切时间?

0 投票
0 回答
67 浏览

neo4j - 我在使用 GRANDstack 的 Netlify 生产中不断收到错误“未知指令”

有没有人遇到以下情况 errorMessage: "Unknown directive "isAuthenticated".↵↵Unknown directive "isAuthenticated"."

我正在使用 GRANDstack 构建我的第一个应用程序,并且我正在尝试在我的 api中使用@hasScope和。@isAuthenticated

在开发中一切正常。当通过 netlify 函数提供服务时,它会在生产中发生。

这是我的 index.js 文件中的代码。

更新:这是我的函数/graphql/graphql.js 文件中的代码

在 makeAugmentedSchema 中包含配置对象后,错误现在变为说no authorisation token

我不确定我是否还有其他事情要做。在开发中一切正常。

0 投票
1 回答
113 浏览

neo4j - 错误:名称为“Long”的类型不存在

我正在执行 GRAND stack real-estate-app “https://www.youtube.com/watch?v=WB--CkjKJMQ&list=PL9Hl4pk2FsvUjfSsxLolVToO5t1hwEIKK&index=2”项目的代码

我已经安装了所有依赖项并配置了数据库并在文件v3.5.18中设置了配置。.env

之后我运行了inferschema:write脚本。

使用以下代码更新了 schema.graphql 文件

然后当我运行服务器时,我给了我以下错误

C:\Users<路径到文件夹>\practice-GRAND->STACK\realEstateApp\api\node_modules\graphql-compose\lib\TypeStorage.js:44

0 投票
1 回答
40 浏览

neo4j - 在 Apollo-server 中接受参数时,字段级密码语句不起作用

字段级别的 cypher 指令无法按预期工作。

最小的例子:

运行以下查询时,出现错误。

这是在 Apollo Playground 中看到的错误日志:

{ "errors": [ { "message": "无效输入 '_someId': 预期\n "!="\n "%"\n " "\n "+"\n ","\n "-"\ n "."\n "/"\n ":"\n "<"\n "<="\n "<>"\n "="\n "=~"\n ">"\n " >="\n "AND"\n "CONTAINS"\n "ENDS"\n "IN"\n "IS"\n "OR"\n "STARTS"\n "XOR"\n "["\n "^"\n "}"(第 1 行,第 195 列(偏移量:194))\n"MATCH ( question: Question) RETURN question {testing: apoc.cypher.runFirstColumn("MATCH (q:Question {id:$someId})返回 q.required", {this: question, cypherParams: $cypherParams,someId: $1_someId}, false)} AS question"\n
^", "locations": [ { "line": 2, "column": 3 } ], "path": [ "Question" ], "extensions": { "code": "INTERNAL_SERVER_ERROR", "exception": { "code": "Neo.ClientError.Statement.SyntaxError", "name": "Neo4jError", "stacktrace": [ "Neo4jError: Invalid input '_someId': expected", " "!="", " "% ""、""
""、""+""、"",""、""-""、"".""、""/""、"":""、""<""、 ""<=""、""<>""、""=""、""=~""、"">""、"">=""、""AND""、""CONTAINS""、""ENDS""、""IN""、""IS""、"" OR""、""STARTS""、""XOR""、""[""、""^""、""}"(第 1 行,第 195 列(偏移量:194))"、""MATCH ( question: Question) RETURN question{testing: apoc.cypher.runFirstColumn("MATCH (q:Question {id:$someId}) RETURN q.required", {this: question, cypherParams: $cypherParams, someId: $1_someId}, false)}作为"ENDS""、""IN""、""IS""、""OR""、""STARTS""、""XOR""、""[""、""^""、""} " (line 1, column 195 (offset: 194))", ""MATCH ( : ) RETURN {testing: apoc.cypher.runFirstColumn("MATCH (q:Question {id:$someId}) RETURN q.required", {this: question, cypherParams: $cypherParams, someId: $1_someId}, false)} AS"ENDS""、""IN""、""IS""、""OR""、""STARTS""、""XOR""、""[""、""^""、""} " (line 1, column 195 (offset: 194))", ""MATCH ( : ) RETURN {testing: apoc.cypher.runFirstColumn("MATCH (q:Question {id:$someId}) RETURN q.required", {this: question, cypherParams: $cypherParams, someId: $1_someId}, false)} ASMATCH ( : ) RETURN {testing: apoc.cypher.runFirstColumn("MATCH (q:Question {id:$someId}) RETURN q.required", {this: question, cypherParams: $cypherParams, someId: $1_someId}, false )} 作为MATCH ( : ) RETURN {testing: apoc.cypher.runFirstColumn("MATCH (q:Question {id:$someId}) RETURN q.required", {this: question, cypherParams: $cypherParams, someId: $1_someId}, false )} 作为question""、"^"、":"、" 在 captureStacktrace (/home/m1/citizentric/grand-housing/node_modules/neo4j-driver-core/lib/result.js:239:17)"、" 在新结果(/home/m1/citizentric/grand-housing/node_modules/neo4j-driver-core/lib/result.js:59:23)", "在 newCompletedResult (/home/m1/citizentric/grand-housing/node_modules/neo4j -driver-core/lib/transaction.js:372:12)", "在 Object.run (/home/m1/citizentric/grand-housing/node_modules/neo4j-driver-core/lib/transaction.js:226: 20)", "在 Transaction.run (/home/m1/citizentric/grand-housing/node_modules/neo4j-driver-core/lib/transaction.js:98:34)", "在 _callee3$ (/home/m1/citizentric/grand-housing/node_modules/neo4j-graphql-js/dist/index.js:226:35)", "在 tryCatch (/home/m1 /citizentric/grand-housing/node_modules/regenerator-runtime/runtime.js:63:40)", "在 Generator.invoke [as _invoke] (/home/m1/citizentric/grand-housing/node_modules/regenerator-runtime/ runtime.js:293:22)", "在 Generator.next (/home/m1/citizentric/grand-housing/node_modules/regenerator-runtime/runtime.js:118:21)", "在 asyncGeneratorStep (/home/ m1/citizentric/grand-housing/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator/index.js:5:24)", " at _next (/home/m1/citizentric/grand-housing/node_modules/@babel /runtime-corejs2/helpers/asyncToGenerator/index.js:27:9)", "at /home/m1/citizentric/grand-housing/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator/index.js:34:7", "at new Promise ()", "at new F (/home/ m1/citizentric/grand-housing/node_modules/@babel/runtime-corejs2/node_modules/core-js/library/modules/_export.js:36:28)", "在 /home/m1/citizentric/grand-housing/ node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator/index.js:23:12", "在 /home/m1/citizentric/grand-housing/node_modules/neo4j-graphql-js/dist/index.js:241 :30" ] } } } ], "数据": { "问题": null } }28)", " 在 /home/m1/citizentric/grand-housing/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator/index.js:23:12", " 在 /home/m1/citizentric/grand-住房/node_modules/neo4j-graphql-js/dist/index.js:241:30" ] } } } ], "data": { "Question": null } }28)", " 在 /home/m1/citizentric/grand-housing/node_modules/@babel/runtime-corejs2/helpers/asyncToGenerator/index.js:23:12", " 在 /home/m1/citizentric/grand-住房/node_modules/neo4j-graphql-js/dist/index.js:241:30" ] } } } ], "data": { "Question": null } }

我的 package.json 包括这些版本:

只要不接受参数,顶级查询(带参数)和带有密码装饰器的字段级查询就可以正常工作。我的印象是这在早些时候就已经奏效了。

0 投票
1 回答
56 浏览

reactjs - 未处理的拒绝(错误):渲染的钩子比上一次渲染时更多(React Interface GrandStack with ApolloClient)

我有一个错误,当我刷新我的页面(在本地主机上)时,我使用基于 Neo4J 数据库的 GrandStack React 接口,我想创建一个带有数据过滤器的表。我使用了在这里找到的代码(CodeSandBox 上的完整代码就在这里

在我使用我的数据之前它工作得很好(使用 ApolloClient)

我在开头声明了以下查询:

然后我定义const 数据并返回下表

它确实可以工作并编译,但是一旦我刷新页面,它就会显示以下错误:

未处理的拒绝(错误):渲染的钩子比上一次渲染期间更多。

它指向这一行:data={React.useMemo(() => data.finalTab, [])}

编辑:我还尝试在 return 语句之前声明数据,如下所示:

然后只返回表格:

但我仍然收到错误

而且我似乎无法理解我做错了什么,有人可以帮忙吗?非常感谢

0 投票
1 回答
86 浏览

neo4j - new Neo4jGraphQL({ typeDefs, driver }) 导致未知指令错误

我正在尝试创建一个新的 GRANDstack 应用程序。数据库已经存在,所以我使用了“infer-schema.js”脚本来生成 gql 模式。当我运行 api 服务器时,我收到以下错误:

这是一个新的 GRANDstack 项目 - 使用以下未触及的 index.js:

使用架构: