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

Aperta
#4,299 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, graphql, openapi

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Go
Stelle
85
Fork
137
Merge medio
1g 12h
PR unite (30g)
247

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di wso2/api-platform

Tutte le issue di wso2/api-platform

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.