Hey guys,
I would love to use the Playground for test queries and such. Any experience in setting this up? AWS AppSync gives you a config file in the following format, but I suspect this is wired to AWS's Apollo Client and probably not something you can use as a generic URL endpoint with Playground:
export default {
"graphqlEndpoint": "https://12345.appsync-api.region-code.amazonaws.com/graphql",
"region": "region-code",
"authenticationType": "API_KEY",
"apiKey": "12345"
}
When you try to enter the endpoint, you get the following error message:
{
"error": "Response not successful: Received status code 401"
}
I tried to paste parts of the config file to the HTTP headers, but that didn't help either (no idea how to format that though). Any ideas?
Looking a the AWS AppSync docs for API_KEY, you pass the key in a header called x-api-key:
Using the 'Http Headers' section of GraphQL Playground, it appears it wants the headers as a JSON object:
{
"x-api-key": "da2-FOOMYKEY"
}
This seemed to allow me to successfully query my API.
It would probably make peoples lives easier if this was included in some of the documentation somewhere, or an 'AWS' mode was added to the UI that just asks for the key or similar.
Awesome! That works for me, too. Thank you! 馃憤
Most helpful comment
Looking a the AWS AppSync docs for
API_KEY, you pass the key in a header calledx-api-key:Using the 'Http Headers' section of GraphQL Playground, it appears it wants the headers as a JSON object:
This seemed to allow me to successfully query my API.
It would probably make peoples lives easier if this was included in some of the documentation somewhere, or an 'AWS' mode was added to the UI that just asks for the key or similar.