Skip to content

Instantly share code, notes, and snippets.

View LawJolla's full-sized avatar

Dennis Walsh LawJolla

View GitHub Profile
@LawJolla
LawJolla / Carousel.tsx
Created April 10, 2024 19:10
Carousel beta, let me know improvements!
import {
BaseEnum,
EnumRef,
InputObjectRef,
InputType,
InputTypeParam,
SchemaTypes
} from "@pothos/core"
import { getModel, PrismaModelTypes } from "@pothos/plugin-prisma"
import Prisma from "@wk/prisma2"
@LawJolla
LawJolla / schema.prisma
Created July 19, 2022 16:29
Prisma 3 schema
generator client {
provider = "prisma-client-js"
}
generator nexusPrisma {
provider = "nexus-prisma"
}
datasource db {
provider = "postgresql"
@LawJolla
LawJolla / datamodel.graphql
Created May 24, 2022 06:29
Prisma 1 datamodel
enum onDelete {
CASCADE
SET_NULL
}
type defaultArray {
id: ID! @id
value: [String] @scalarList(strategy: RELATION)
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
@LawJolla
LawJolla / schema-prod.prisma
Created May 24, 2022 06:28
Schema used in production
generator client {
provider = "prisma-client-js"
}
generator nexusPrisma {
provider = "nexus-prisma"
}
datasource db {
provider = "postgresql"
@LawJolla
LawJolla / schema-db-pull.prisma
Created May 24, 2022 06:26
Schema from db pull
generator client {
provider = "prisma-client-js"
}
generator nexusPrisma {
provider = "nexus-prisma"
}
datasource db {
provider = "postgresql"
@LawJolla
LawJolla / apolloClient.tsx
Created April 20, 2021 20:05
Apollo Client Example
import React, { useMemo } from "react"
import { ApolloClient, InMemoryCache, from } from "@apollo/client"
import { setContext } from "@apollo/client/link/context"
import { createUploadLink } from "apollo-upload-client"
import { onError } from "@apollo/client/link/error"
let apolloClient
const uri = ({ operationName }) => {
if (operationName.includes(`Sanity`)) {
@LawJolla
LawJolla / PictureWithSpinner.tsx
Created April 9, 2021 17:09
NextJS Picture with Spinner
import * as React from "react"
import { SkeletonPicture } from "./SkeletonPicture"
import { AnimatePresence, motion } from "framer-motion"
import { AbsoluteSpinner } from "@wk/shared-ui"
import { default as NextImage, ImageProps } from "next/image"
import { myNextImgLoader } from "../pageComponents/vehicle/SwipeImages"
import { VehicleFragmentFragment } from "../../generated/graphql"
import { Unarray } from "../../interfaces/vehicles"
type IPictureWithSpinner = {
@LawJolla
LawJolla / .eslintrc
Created September 16, 2019 17:11
Global eslint
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"allowImportExportEverywhere": false,
"codeFrame": false
},
"env": {
"es6": true,
"browser": true,
@LawJolla
LawJolla / .eslintrc
Created September 16, 2019 17:10
Global Eslint
extend