Skip to content

Instantly share code, notes, and snippets.

View avalla's full-sized avatar
🤣
behind every kiss a potential judas

Andrea Valla avalla

🤣
behind every kiss a potential judas
View GitHub Profile
@avalla
avalla / graphql-apollo-moleculer-error-formatter.js
Last active June 7, 2019 12:41 — 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
const CLS_CONTEXT_ATTRIBUTE = 'ctx';
// 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
// reporing. That alone would not be a problem, but moleculer's context
@avalla
avalla / ext.register.php
Last active December 14, 2015 04:39
Register Extension for VldPersonals ext.register.tpl is customized, the form's action is the register page, so error messages will go there Howto call the Extension: use the {register:} tag in .tpl file ex. <!-- IF active_module == "homepage" --> <!-- IF loggedin == "0" --> <div class="well"> {register:} </div> <!-- ENDIF --> <!-- ENDIF -->
<?php
/*
=====================================================
vldPersonals - by VLD Interactive
----------------------------------------------------
http://www.vldpersonals.com/
http://www.vldinteractive.com/
-----------------------------------------------------
Copyright (c) 2005-2011 VLD Interactive
=====================================================