wso2 / api-manager

All issues, tasks, improvements and new features of WSO2 API Manager
Apache License 2.0
34 stars 8 forks source link

GraphQL invocation does not work with api key headers #2669

Closed vishmi49 closed 7 months ago

vishmi49 commented 7 months ago

Description

GraphQL invocation does not work with api key headers. Currently custom header support for api-key header feature is implemented only for Rest apis.

And currently in the publisher portal a user can add custom headers for api keys for graphQL and it's not working for graphQL apis.

Screenshot 2024-03-18 at 12 29 06

Therefore the graphQL does not work with default api-keys which is working properly in 4.2.0 version.

API key header input box needs to be hidden for graphQL

Steps to Reproduce

  1. Login to publisher portal
  2. Create a graphql API and publish
  3. Select api keys under the run time tab ( note that user can add custom headers for api keys here)
  4. Login to the devportal.
  5. Subscribe to the api and generate api keys
  6. Invoke graphQL api with default api keys.

Affected Component

APIM

Version

4.3.0

Environment Details (with versions)

No response

Relevant Log Output

No response

Related Issues

No response

Suggested Labels

No response

BLasan commented 7 months ago

Getting the below error

{
  "errors": [
    {
      "message": "Failed to fetch",
      "stack": "TypeError: Failed to fetch\n    at https://localhost:9443/devportal/site/public/dist/9920.9b2bb8b405df5085d453.bundle.js:2:183754\n    at Generator.next (<anonymous>)\n    at s (https://localhost:9443/devportal/site/public/dist/9920.9b2bb8b405df5085d453.bundle.js:2:183485)\n    at https://localhost:9443/devportal/site/public/dist/9920.9b2bb8b405df5085d453.bundle.js:2:183446\n    at new Promise (<anonymous>)\n    at r.<computed>.a.<computed> [as next] (https://localhost:9443/devportal/site/public/dist/9920.9b2bb8b405df5085d453.bundle.js:2:183398)\n    at https://localhost:9443/devportal/site/public/dist/9920.9b2bb8b405df5085d453.bundle.js:2:149199"
    }
  ]
}
BLasan commented 7 months ago

Fixed via https://github.com/wso2/apim-apps/pull/608 https://github.com/wso2/carbon-apimgt/pull/12340