diff --git a/templates/Lambda4AppSyncHTTP/index.mjs b/templates/Lambda4AppSyncHTTP/index.mjs index 65fe8d9..8b5ef39 100644 --- a/templates/Lambda4AppSyncHTTP/index.mjs +++ b/templates/Lambda4AppSyncHTTP/index.mjs @@ -61,10 +61,15 @@ export const handler = async (event) => { timeout: 20000 }; - if (resolver.language == 'opencypher') { - result = await axios.post(`https://${process.env.NEPTUNE_HOST}:${process.env.NEPTUNE_PORT}/opencypher`, `query=${encodeURIComponent(resolver.query)}¶meters=${encodeURIComponent(JSON.stringify(resolver.parameters))}`, myConfig); + if (resolver.language === 'opencypher') { + result = await axios.post(`https://${process.env.NEPTUNE_HOST}:${process.env.NEPTUNE_PORT}/opencypher`, { + query: resolver.query, + parameters: JSON.stringify(resolver.parameters) + }, myConfig); } else { - result = await axios.post(`https://${process.env.NEPTUNE_HOST}:${process.env.NEPTUNE_PORT}`, `gremlin=${encodeURIComponent(resolver.query)}`, myConfig); + result = await axios.post(`https://${process.env.NEPTUNE_HOST}:${process.env.NEPTUNE_PORT}/gremlin`, { + gremlin: resolver.query + }, myConfig); } if (LOGGING_ENABLED) console.log("Result: ", JSON.stringify(result.data, null, 2)); } catch (err) {