Skip to content

Instantly share code, notes, and snippets.

@trmaphi
trmaphi / graphql-apollo-xray-error-formatter.js
Created January 4, 2021 04:28 — forked from mdlavin/graphql-apollo-xray-error-formatter.js
An Apollo Server formatError function that avoids "Converting circular structure to JSON" errors
// This is the attribute that continuation local storage uses to hold onto
// the current context. The value comes from https://github.com/othiym23/node-continuation-local-storage/blob/fc770288979f6050e4371c1e1b44d2b76b233664/context.js#L11
const CLS_CONTEXT_ATTRIBUTE = 'error@context';
// A formatError function that can be used with
// https://www.apollographql.com/docs/apollo-server/features/errors#for-the-client-response
function formatError (err) {
// The continuation-local-storage module attaches a context attribute to
// errors so that the context can be resolved from errors. The attribute
// is enumerable by default and so it gets included in GraphQL error
@trmaphi
trmaphi / GNUPG_agent_forwarding.md
Created November 15, 2022 17:58 — forked from TimJDFletcher/GNUPG_agent_forwarding.md
GnuPG agent forwarding

Forward GnuPG agent from macOS to Linux

On the remote machine

Run gpg once as your to create the directory structure

gpg --list-keys

For headless systemd based hosts