npm.io
1.0.1-35 • Published 5 years ago

@tripzapp/shared-typings

Licence
ISC
Version
1.0.1-35
Deps
4
Size
34 kB
Vulns
0
Weekly
0

TripZapp Typings

This repository holds shared type declarations used across TripZapp typescript codebase.

Installation

Use the npm package manager to install.

npm install @tripzapp/shared-typings --save-dev

Usage

// partner.ts - example mutation file

import { User } from "@tripzapp/shared-typings";

export default async (
  _: User.BaseUser,
  args: void,
  { prisma }: GraphQLContext,
  info: any
) => {
  try {
    if (_.userType === User.Type.Partner)
      return await prisma.partnerDetails.findOne({
        where: { id: _.id },
      });
  } catch (err) {
    throw err;
  }
};

Contributing

Before pushing any updates to this repo, if you haven't already, add your name and email in the index.ts.

Please make sure to update tests as appropriate.

License

MIT