update
This commit is contained in:
11
src copy/resolvers/queryResolvers.ts
Normal file
11
src copy/resolvers/queryResolvers.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { generateToken } from '../index.ts';
|
||||
|
||||
export const queryResolvers = {
|
||||
info: () => `This is the API of a Hackernews Clone`,
|
||||
feed: async (parent, args, context) => {
|
||||
if (!context.user) {
|
||||
throw new Error('Not authenticated');
|
||||
}
|
||||
return context.prisma.link.findMany();
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user