mirror of
https://github.com/wassname/talk.git
synced 2026-08-16 11:29:31 +08:00
Implement post comment mutation
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
declare module "relay-runtime" {
|
||||
export const ROOT_ID: string;
|
||||
}
|
||||
|
||||
import { Environment, ROOT_ID } from "relay-runtime";
|
||||
|
||||
export default function getMe(environment: Environment) {
|
||||
const source = environment.getStore().getSource();
|
||||
const root = source.get(ROOT_ID)!;
|
||||
const meKey = Object.keys(root).find(s => s.startsWith("me("))!;
|
||||
if (!root[meKey]) {
|
||||
return null;
|
||||
}
|
||||
const meID = root[meKey].__ref;
|
||||
return source.get(meID)!;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export { default as getMe } from "./getMe";
|
||||
Reference in New Issue
Block a user