如何使用 Spring Boot 在 Netflix DGS 中配置 graphql 端点

问题描述 投票:0回答:1

我有一个使用 Netflix DGS (8.2.2) 和 Spring Boot (3.2.1) 的简单的 hello world 示例,默认情况下,graphql 端点在 /graphql 端点上公开

我尝试通过在 application.yml 中添加配置来将 graphql 端点更改为 /gql

dgs:
  graphql:
    endpoint: /gql

它不起作用。我仍然只能访问 /graphql 上的应用程序 知道出了什么问题吗?

spring-boot graphql netflix-dgs
1个回答
0
投票

文档在这里:https://netflix.github.io/dgs/configuration/

看起来您需要指定“路径”,而不是“端点”:

dgs:
  graphql:
    path: /gql
© www.soinside.com 2019 - 2024. All rights reserved.