How to use the warthog.Server function in warthog

To help you get started, we’ve selected a few warthog 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 goldcaddy77 / warthog-starter / src / server.ts View on Github external
export function getServer(AppOptions = {}, dbOptions = {}) {
  return new Server(
    {
      // Inject a fake user.  In a real app you'd parse a JWT to add the user
      context: (request: any) => {
        const userId = JSON.stringify(request.headers).length.toString();

        return {
          user: {
            id: `user:${userId}`
          }
        };
      },
      introspection: true,
      logger: Logger,
      ...AppOptions
    },
    dbOptions

warthog

Opinionated set of tools for setting up GraphQL backed by TypeORM

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis