Resolvers

Resolvers tell Kontrl where your data lives. If you want data from PostgreSQL then you can use the PostgreSQL resolver. If you need data from MySQL you’ll be using the MySQL resolver and so forth.

Your data does not all to come from the same place. But you need a resolver for every place your data is coming from. More about this in the “table” section.

Postgres resolver

The postgres resolver works with the node-postgres library. The resolver takes 2 parameters.

  1. The postgres Client or Pool.
  2. The table name
const kontrl = require("kontrl");

const resolver = kontrl.resolver.postgres(pgclient, "users");