[Bug]: GraphQL deployment metadata (vhostMain, endpointUrl) is accepted and returned but has no effect

Open
#4,299 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go, graphql, openapi

Research direction

Start with the GraphQL deployment path and the REST deployment path for comparison, then read platform-api/resources/openapi.yaml for the metadata contract. Trace how deployment metadata is translated into the stored artifact and gateway configuration, focusing on vhostMain and endpointUrl. Done means these settings either affect GraphQL routing as expected or the deployment request rejects them with 400; add or run the relevant deployment and routing tests.

Written by the indexing model from the issue text.

Description

Area/Platform-API Aspect/API Severity/Minor Type/Bug
Please select the area the issue is related to

Platform API

Please select the aspect the issue is related to

Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)

Description

A GraphQL API deployment accepts the vhostMain and endpointUrl metadata keys, stores them, and returns them on the deployment. Neither has any effect:

  • vhostMain: the stored artifact has no vhosts, and the API answers on any Host. A request with Host: unrelated.example returned 200.
  • endpointUrl: the backend still received requests at the API's own upstream path (/graphql), not at the configured /override.

The DeployRequest.metadata description in platform-api/resources/openapi.yaml lists these keys as supported "for REST APIs". A REST API deployed with the same metadata applies both: the API is served only on the configured vhost, at the overridden endpoint. So for GraphQL the keys are unsupported but silently accepted, and the response suggests they took effect.

Expected: the keys take effect for GraphQL APIs, or the deployment request rejects them with 400.
Actual: they are stored and returned as if applied, but ignored.

Steps to Reproduce
  1. Create a GraphQL API (multipart POST /api/v0.9/graphql-apis, metadata part):
    {"id":"b12-gql","displayName":"b12-gql","context":"/b12","version":"v1","projectId":"default","schemaSource":"inline","sdl":"type Query { hello: String }","upstream":{"main":{"url":"<echo-backend>/graphql"}}}.
  2. Deploy it with metadata: POST /api/v0.9/graphql-apis/b12-gql/deployments with {"name":"d1","base":"current","gatewayId":"<gateway-id>","metadata":{"vhostMain":"gql.example.com","endpointUrl":"<echo-backend>/override"}}. It becomes DEPLOYED, and GET .../deployments/<deploymentId> returns that metadata.
  3. Read the stored artifact (SELECT content FROM deployments WHERE uuid='<deploymentId>'). It has no vhosts, and upstream.main.url is <echo-backend>/graphql.
  4. Call POST <router>/b12 with Host: unrelated.example. It returns 200.
  5. Call POST <router>/b12 with Host: localhost. It returns 200, and the echo backend shows path /graphql.
  6. For comparison, deploy a REST API with {"vhostMain":"rest.example.com","endpointUrl":"<echo-backend>/override"}. Host: localhost returns 404, and Host: rest.example.com reaches /override/....
Severity Level of the Issue

Severity/Minor (Non-critical functionality. Can be fixed in future releases)

Environment Details (with versions)
  • Source: main at f5c93849.
  • platform-api built from source (SQLite).
  • Gateway images (gateway-controller / gateway-runtime 2026.09.24) built from that commit.
  • Echo backend: ghcr.io/wso2/api-platform/sample-service:latest.
  • macOS with Rancher Desktop.
Dominant language
Go
Stars
85
Forks
137
Avg merge
1d 12h
Merged PRs (30d)
247

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wso2/api-platform

All issues in wso2/api-platform

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.