I have one React Amplify app running with two environments. One environment is for my wife's blog (www.riahraineart.com) and one for my blog (www.joshmk.com). Both sites are running off the same repo, I'm just configuring the site's differently based on an environment variable I use to retrieve their configurations from a table.
useEffect(() => {
async function fetchData() {
const configData = await API.graphql({
query: queries.getConfiguration,
variables: { id: process.env[configIdName] },
});
if (configData && isMounted.current)
setConfig(configData.data.getConfiguration || {});
}
if (process.env[configIdName]) {
fetchData();
}
}, [isMounted, configIdName]);
For my site, when I make the GraphQL request for this configuration, it's successful and the site spins up. For my wife's site, this call to the configurations table silently fails. By silent, I mean there's no helpful response being returned from the API even though it's a successful 200 response.
When I open AppSync, go to the two environments and run the queries, I receive the configuration items. I also see them when I open dynamodb.
I'm thinking there could be some expired token for something somewhere but if that was the case, I would think I'd receive a failed response that would state that.
Another possibility could be that my wife had modified the configuration of her site or created a post with some content that the frontend doesn't expect. But in that case, I would atleast expect to see a response from the call to receive her sites configuration.
Thank you beforehand for any insights here!