The key will be the relay globalID and store all db item data. When the node is recovered, the viewerCanSee will filter this.
postGlobalID
postGlobalID
commentGlobalID
import { redirect, type LoaderFunctionArgs } from '@remix-run/node' | |
import { Form, useLoaderData } from '@remix-run/react' | |
import { sessionCookie } from '../session.server' | |
export async function loader({ request }: LoaderFunctionArgs) { | |
const cookieHeader = request.headers.get('Cookie') | |
const cookie = await sessionCookie.parse(cookieHeader) | |
if (!cookie) { | |
return redirect('/login') | |
} |
import { AsyncLocalStorage } from 'async_hooks' | |
import DataLoader from 'dataloader' | |
import { ObjectId } from 'mongodb' | |
import { z } from 'zod' | |
import { | |
Connection, | |
ConnectionArgs, | |
connectionArgsSchema, |
[flake8] | |
max-line-length = 88 | |
extend-exclude = .venv | |
extend-ignore = | |
E203, # whitespace before ':' (conflicts with Black) | |
E231, # Bad trailing comma (conflicts with Black) | |
E501, # line too long (conflicts with Black) | |
W503, # line break before binary operator (conflicts with Black) |
// Reference: https://relay.dev/docs/guides/network-layer | |
import { Environment, Network, RecordSource, Store } from 'relay-runtime'; | |
// Function to get the authentication token | |
export const getToken = () => { | |
return localStorage.getItem('authentication_token'); | |
}; | |
// Define a function that fetches the results of an operation (query/mutation/etc) |
// History | |
import { createBrowserHistory } from 'history'; | |
const history = createBrowserHistory(); | |
export default history; | |
// App | |
import React from 'react'; | |
import { Router } from 'react-router-dom'; |