forked from cerc-io/snowballtools-base
e4c099f8c3
* Add context to each request * Implement get user db query * Move constants to a separate file * Refactor database init method
17 lines
326 B
TypeScript
17 lines
326 B
TypeScript
import { Database } from './database';
|
|
|
|
export const createResolvers = async (db: Database): Promise<any> => {
|
|
return {
|
|
Query: {
|
|
user: (
|
|
_: any,
|
|
__: any,
|
|
// TODO: add custom type for context
|
|
context: any
|
|
) => {
|
|
return db.getUser(context.userId);
|
|
}
|
|
}
|
|
};
|
|
};
|