I need a basic query to take all users from graphql but only with selected fields such as email, name etc. I couldn’t figure out how it works, aws doc gives example about filtering but it uses id to filter.
export const getUsers = async () => {
try {
const { data } = await API.graphql({
query: listUsers,
});
if (data.listUsers.items) {
console.log(data.listUsers.items);
return "data.listUsers.items";
} else {
return null;
}
} catch (e) {
}
};
This prints out everything about users but I want only a few fields, how can I filter these fields? I need something around query area but?