I have tried a simple AWS Lambda that executes a query against AppSync to return data and also tried a query that invokes a mutation to add new data.
For both the query just returns null
But there are no error messages displayed.
AWS cloudwatch reads:
67548b14-2c8e-40fa-8437-ca2e79c00cbd GraphQL Query: query MyQuery {
listGuido1S {
items {
id
name
}
}
}
, Operation: null, Variables:
{}
Interesting: Operation is always null.
The code I use is:
import AppsyncClient from 'appsync-client';
import gql from "graphql-tag";
export async function handler(evt: any, ctx: any) {
// const query = gql(`
// mutation MyMutation($x: CreateGuido1Input!) {
// createGuido1(input: $x ) {
// name
// id
// }
// }
// `);
const query = gql(`
query MyQuery {
listGuido1S {
items {
id
name
}
}
}
`);
const client = new AppsyncClient({
apiUrl: process.env.API_URL
});
try {
const res = await client.request({
query: query,
variables: {}
});
return res;
} catch (err) {
console.error('error: ', err);
throw (err);
}
}
The operations succeed when invoked via AWS console.
I have tried a simple AWS Lambda that executes a query against AppSync to return data and also tried a query that invokes a mutation to add new data.
For both the query just returns
nullBut there are no error messages displayed.
AWS cloudwatch reads:
Interesting: Operation is always null.
The code I use is:
The operations succeed when invoked via AWS console.