Skip to content

Instantly share code, notes, and snippets.

View pelly-ryu's full-sized avatar

pelly ryu pelly-ryu

View GitHub Profile
@pelly-ryu
pelly-ryu / graphql-directives.js
Last active June 17, 2023 21:17 — forked from pikanji/graphql-directives.js
Amplify GraphQL Directive Definitions
import gql from "graphql-tag";
// https://docs.amplify.aws/cli-legacy/graphql-transformer/directives/
const clientSchemaExtensions = gql`
# https://docs.amplify.aws/cli/graphql/data-modeling/#how-it-works
directive @model(
queries: ModelQueryMap
mutations: ModelMutationMap
subscriptions: ModelSubscriptionMap
timestamps: TimestampConfiguration
@pelly-ryu
pelly-ryu / core.ts
Created October 27, 2023 01:01
/adapters/indexedDB/core.ts
import { captureException } from "@sentry/vue";
import { type DBSchema, openDB } from "idb";
import { IDBPDatabase } from "idb/build/entry";
export enum StoreName {
VisitLocation = "visitLocation",
ActionLog = "actionLog",
}
export interface LocationWithTimestamp {
@pelly-ryu
pelly-ryu / visitLocation.ts
Created October 27, 2023 01:02
adapters/indexedDB/visitLocation.ts
import { type StoreKey } from "idb";
import {
type DefaultDB,
type LocationWithTimestamp,
StoreName,
getDb,
} from "@/adapters/indexedDB/core";
type Store = {