INNER CODE UNIT · TypeScript

resolveExamplePath

graphql-compose/graphql-compose-examples · config.ts:15

export function resolveExamplePath(...args: any) {
  return path.resolve(examplesPath, ...args);
}

export function getExampleNames() {
  const preferableOrder = ['user', 'northwind', 'mongooseDiscriminators'];
  const dirs = getDirectories(examplesPath);

  const result = [];
  preferableOrder.forEach((name) => {
    const idx = dirs.indexOf(name);
    if (idx !== -1) {
      result.push(name);
      dirs.splice(idx, 1);
    }
  });
  dirs.forEach((name) => {
    result.push(name);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…