Skip to content

Instantly share code, notes, and snippets.

View omavi's full-sized avatar

omavi

  • Webflow
  • Richmond, Virginia
  • 08:24 (UTC -04:00)
View GitHub Profile
@omavi
omavi / bufferTransformCacheHandlerShim.js
Created April 17, 2025 02:42
NextJS 15 cache handler shim for transforming buffers appropriately
/**
* This cache handler shim ensures compatibility with Redis, by converting
* buffers to strings on save and back to buffers on read, since the data
* is stored as JSON.
*
* This shim is a temporary workaround until Next 15 support is added to
* @neshca/cache-handler:
* https://github.com/caching-tools/next-shared-cache/pull/969
*
* @param {import("@neshca/cache-handler").Handler} handler - The original cache handler to wrap.
@omavi
omavi / GraphiQLExplorer.tsx
Created January 21, 2021 22:08 — forked from baohouse/GraphiQLExplorer.tsx
Fork of graphiql-explorer 0.4.5 to support list types and object-based custom args
/**
* Copied from https://github.com/OneGraph/graphiql-explorer (0.4.5)
* We fork because we need to support customizable fields and could not wait for
* the PR process to finish. Also converted Flow type to TypeScript.
*/
import { Tooltip } from 'antd';
import prettier from 'prettier/standalone';
import parserGraphql from 'prettier/parser-graphql';
import React, { Fragment } from 'react';