首页 > 解决方案 > GraphQL API 前的 Google Endpoint

问题描述

我似乎找不到任何在 GraphQL API 前设置 Google Endpoint API Gateway 的参考资料。

任何帮助或提供参考资料都会很棒。

谢谢,布赖恩

标签: graphqlgoogle-cloud-endpoints

解决方案


我测试了这个设置并且它有效。假设你有一个api.test.com/graphql端点,你需要在你的 yaml 配置文件中定义一个路径:

paths:
  /graphql:
    post:
      description: "graphql http-post endpoint"
      operationId: "graphql-post"
      produces:
        - "application/json"
      responses:
        200:
          description: "Echo"
          schema:
            $ref: "#/definitions/echo_message"

推荐阅读