Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async user(_: null, args: { id: string }) {
try {
const userDoc = await admin
.firestore()
.doc(`users/${args.id}`)
.get();
const user = userDoc.data() as User | undefined;
return user || new ValidationError('User ID not found');
} catch (error) {
throw new ApolloError(error);
}
}
},