API Key authenticated GraphQL I/O Doc usage reference
An API key is issued to a developer application and sent with every request. Cloud API Management validates the key before forwarding the request to the backend.
The API Key authentication type is determined by the Request Authentication Type field, and the API key location - Header, Parameters, or Path - is determined by the Developer's API Key Location field configured on the Key & Method Detection page.
Depending on the authentication configuration on the Key & Method Detection page, the GraphQL editor automatically loads the correct credential form. The developer must provide their application's API key in the GraphQL editor's authentication field, either in the header, parameters, or path.
After providing the API key, adding the query fields, and clicking Execute query, the editor sends your API key with the request to the server, and the response results appear on the right side of the interface.
Use case 1: API Key + Header + Key Field Identifier
The following is an example of how to test an API Key + Header-authenticated GraphQL I/O Doc on the Developer Portal > Interactive Documentation page.
Adding a query
On the left-hand side, the editor automatically fetches all the query fields from the schema configured for an endpoint on the Key & Method Detection page.
The Request Authentication Type is set to API Key, the Developer's API Key Location is set to Header, and the Key Field Identifier is set to api_key on the Key & Method Detection page. The Key Field Identifier value determines the name of the header field to send the API key. Review Prerequisites for using API Key authenticated GraphQL I/O Doc for more information.
To test your GraphQL API, enter your application's API key in the GraphQL editor's authentication field, and add fetched schema query fields to the query operation. Select the fields to insert them into the query operation, or write a query directly in the editor. Then, run the query by clicking the Execute query button. The editor sends your key in the request header as api_key with every request. On the right-hand side, the query returns results as a JSON object in the editor.

Use case 2: API Key + Parameters + Key Field Identifier
The following is an example of how to test an API Key + Parameters-authenticated GraphQL I/O Doc on the Developer Portal > Interactive Documentation page.
Adding a query
On the left-hand side, the editor automatically fetches all the query fields from the schema configured for an endpoint on the Key & Method Detection page.
The Request Authentication Type is set to API Key, the Developer's API Key Location is set to Parameters, and the Key Field Identifier is set to api_key on the Key & Method Detection page. The Key Field Identifier value determines the name of the header field in the query parameter to send the API key. Next, ensure you have configured the public and backend domains and paths on the Domains & Traffic Routing page. Review Prerequisites for using API Key authenticated GraphQL I/O Doc for more information.
To test your GraphQL API, enter your application's API key in the GraphQL editor's authentication field, add query fields or write a query directly in the editor, then click Execute query. The editor sends your key in the request URL as a query parameter with every request. On the right-hand side, the query returns results as a JSON object in the editor.

Use case 3: API Key + Path + Key Field Identifier
The following is an example of how to test an API Key + Path + Key Field Identifier-authenticated GraphQL I/O Doc on the Developer Portal > Interactive Documentation page.
Adding a query
On the left-hand side, the editor automatically fetches all the query fields from the schema configured for an endpoint on the Key & Method Detection page.
The Request Authentication Type is set to API Key, the Developer's API Key Location is set to Path, and the Key Field Identifier is set to 1 on the Key & Method Detection page. The Key Field Identifier value determines the position of the API key in the public endpoint path. Next, ensure you have configured the public and backend domains and paths on the Domains & Traffic Routing page. Review Prerequisites for using API Key authenticated GraphQL I/O Doc for more information.
To test your GraphQL API, enter your application's API key in the GraphQL editor's authentication field, add query fields or write a query directly in the editor, then click Execute query. The editor appends your key as a path segment in the endpoint URL with every request. On the right-hand side, the query returns results as a JSON object in the editor.
