首页 > 解决方案 > 如何在springboot中修改graphql端点URL

问题描述

我在 springboot 中创建了一个简单的 graphql 实现。

现在,要获取 API,我必须使用 URL http://localhost:XXXX/graphql,但我想在http://localhost:XXXX/api/graphql. 我想api/在它之前追加。怎么做?

我尝试了所有在线解决方案来在 application.ymls 中编写代码,例如

使用网址

**graphiql:
  url: /api/graphql
  enabled: true

或修改端点

graphiql:
    endpoint:
      graphql: /api/graphql
    enabled: true** 

没有任何效果。

标签: javaspring-bootgraphqlgraphql-java

解决方案


推荐阅读