UNPKG

graphql-compose

Version:

GraphQL schema builder from different data sources with middleware extensions.

15 lines (10 loc) 305 B
export function deprecate(msg) { let stack; let stackStr = ''; const error = new Error(); if (error.stack) { stack = error.stack.replace(/^\s+at\s+/gm, '').split('\n'); stackStr = `\n ${stack.slice(2, 7).join('\n ')}`; } console.log(`DEPRECATION: ${msg} ${stackStr}\n\n`); }