How to use graphile-build - 1 common examples

To help you get started, we’ve selected a few graphile-build examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphile / graphile-engine / packages / postgraphile-core / src / index.ts View on Github external
pluginToSkip => basePluginList.indexOf(pluginToSkip) < 0
  );
  if (invalidSkipPlugins.length) {
    function getFunctionName(fn: Plugin) {
      return fn.displayName || fn.name || String(fn);
    }
    throw new Error(
      `You tried to skip plugins that would never have been loaded anyway. Perhaps you've made a mistake in your skipPlugins list, or have sourced the plugin from a duplicate plugin module - check for duplicate modules in your 'node_modules' folder. The plugins that you requested to skip were: ${invalidSkipPlugins
        .map(getFunctionName)
        .join(", ")}`
    );
  }
  const finalPluginList = basePluginList.filter(
    p => skipPlugins.indexOf(p) === -1
  );
  return getBuilder(finalPluginList, {
    pgConfig,
    pgSchemas: Array.isArray(schemas) ? schemas : [schemas],
    pgExtendedTypes: !!dynamicJson,
    pgColumnFilter: pgColumnFilter || (() => true),
    ...({
      pgInflection:
        inflector ||
        (classicIds
          ? postGraphileClassicIdsInflection
          : postGraphileInflection),
    } as any),
    nodeIdFieldName: nodeIdFieldName || (classicIds ? "id" : "nodeId"),
    pgJwtTypeIdentifier: jwtPgTypeIdentifier,
    pgJwtSecret: jwtSecret,
    pgJwtSignOptions: jwtSignOptions,
    pgDisableDefaultMutations: disableDefaultMutations,

graphile-build

Build a GraphQL schema from plugins

MIT
Latest version published 2 years ago

Package Health Score

66 / 100
Full package analysis

Popular graphile-build functions