问题标签 [graphql-java]
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.
java - 春季启动启动器graphql不工作
我最近开始使用graphql
它,发现它非常有趣。由于我的大多数rest
应用程序都在 中java
,我决定使用团队提供的spring boot 启动器项目进行快速设置。graphql-java
它带有graph-iql
autoconf spring 设置,可以更轻松地查询/graphql
端点。
在 IDEA 中的项目设置上花了几个小时后,我能够运行graphql-sample-app。但我认为我的 servlet 仍未启用,只有graphiql
端点正在运行,因为默认查询正在返回404
。
这是application.yml
:
这是我的build.gradle
文件的样子:
运行后gradle build
,我jar
从终端运行生成的文件。这是我在本地主机上得到的:
java - java - 如何递归遍历java中的graphql文档并找到它达到的最深层次
我的目标是遍历一个 graphql Java 文档对象并返回最大深度。
示例:深度 0
示例:深度 1
示例:深度 2
示例:深度 2。如您所见,两张专辑/歌曲都在同一个父“查看者”下
示例:深度 3
我已经编写了基本代码来遍历它,但是我的代码不适用于深度 = 2 的第二个版本。它返回深度 = 3 而不是 2。原因是因为它在同一个父级下计数了两次。本质上的逻辑是这样的:当一个字段有孩子时,深度 = 深度 + 1。
我被困住了,如果有更深入的递归知识的人能够帮助我,我将不胜感激。
graphql - GraphQL 权限文档
您如何记录某些集合只能由具有相同权限/角色的用户访问或更改,例如只有经过身份验证的用户才能写评论?
java - 用于 Java-GraphQL 服务器的 Java 中基于中继的分页
我已经使用GraphQL-Java-tools实现了一个基于 java 的 GraphQL 服务器。现在我需要使用我拥有的 Java-GraphQL 服务器来实现基于 Relay 的分页。
我在那里找不到任何有用的东西。谁能帮我指出正确的地方来找到如何在 Java_GraphQL 服务器中实现基于中继的分页?
感谢期待。
java - graphql java:全局dataFetcher和动态对象
我正在尝试使用 GraphQL 之类的 REST API 客户端。我的后端返回 JSON,但在我的应用程序客户端中我编写了 graphQL,在客户端中我将 graphQL 查询转换为 HTTP 调用。
我的架构:
POJO 示例:
我的解析器:
在所有库的实现中,我需要为 Student 创建一个 POJO,并在我的 API 中为请求编写一个解析器。
是否存在不需要创建 POJO 和创建全局执行解析器的方法?
java - GraphQL 支持 websocket 吗?
GraphQL-Java 是否支持 websockets?好像不支持。我似乎找不到任何有关此的信息,因此将非常感谢任何帮助。
authentication - authentication in spring boot using graphql
I’m working on a spring boot project with GraphQL. I'm using graphql-java-tools and graphql-spring-boot-starter. I managed to configure security and session management with spring security as you can see in the java config files below.
Now the “/graphql” path is secured (it can be accessed only sending the “basic http authentication” or a session token (x-auth-token
) in a http header of the request). Authenticating with “basic http authentication” on any GraphQL operation will start a new session and send back the new session token in a header, and that token can be used further to continue that session.
How to give access to anonymous users to some GraphQL queries/mutations keeping the above behavior?
If I change antMatchers("/graphql").authenticated()
to antMatchers("/graphql").permitAll()
in order to allow anonymous access, then my custom AuthenticationProvider
is not called anymore even when I try to authenticate with “basic http authentication”.
Thanks!
Here are my configs:
java - Graphql 接受用户定义的对象列表
我有一个要求,我必须接受对象列表。
突变类中的方法如下所示
PingEntity 看起来像这样
我的查询看起来像这样
我得到这样的错误:
我尝试给出不同的注释。我无法解决这个问题..在这个问题上需要帮助
提前致谢 :)
java - Graphql-java 中的自定义标量
我们计划在我们的应用程序中使用 Graphql 作为后端服务器。我们选择 Graphql-Java 来开发我们的 POC。我们遇到了创建自己的标量类型来处理 java.util.Map 对象类型的情况。
我们还没有找到任何有关创建自定义标量类型的文档。在如下示例代码中
如何为 CustomScalar 对象完成实现。需要帮忙。
java - 三引号字符串的antlr语法
我正在尝试更新遵循以下规范的 ANTLR 语法
https://github.com/facebook/graphql/pull/327/files
从逻辑上讲,它定义为
(不是上述是合乎逻辑的 - 不是 ANTLR 语法)
我在 ANTRL 4 中尝试了以下操作,但它无法识别三引号字符串中的超过 1 个字符
使用这些规则,它会识别 '"""a"""' 但只要我添加更多字符,它就会失败
例如:'"""abc"""' 不会解析并且 ANTLR 的 IntelliJ 插件说
如何在 ANTLR 中使用 '\"""' 转义三引号字符串?