@graphql-mesh/http
Version:
11 lines (10 loc) • 470 B
JavaScript
import { process } from '@graphql-mesh/cross-helpers';
export function resolvePlaygroundConfig(playground, defaultEnabled = process.env.NODE_ENV !== 'production') {
if (typeof playground === 'boolean') {
return { enabled: playground, offline: false };
}
if (playground != null && typeof playground === 'object') {
return { enabled: true, offline: playground.offline === true };
}
return { enabled: defaultEnabled, offline: false };
}