2.12.3 • Published 1 year ago

@jambff/prisma-api v2.12.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Jambff Prisma API

Extends @jambff/api with additional helpers for APIs built using Prisma.

Installation

Install with your favourite package manager:

yarn add @jambff/prisma-api

You should also install all peerDependencies.

Search query parser

Parses a query string to the format required for a Prisma where query. Supports nested object queries via dot notation.

import { parseFilterQuery, FilterType } from '@jambff/prisma-api';
import qs from 'qs';

const queryString = '?filter[published]=true&filter[imageId]=lte:10&filter[image]=title.contains:something';
const queryObject = qs.parse(queryString, { arrayFormat: 'brackets' });

const filterTypes = {
  published: FilterType.BOOLEAN,
  imageId: FilterType.NUMBER,
  image: {
    title: FilterType.STRING,
  },
};

const prismaQuery = parseFilterQuery(filterTypes, queryObject);
// [
//   { published: true },
//   { imageId: { lte: 10 },
//   { image: { title: { contains: "something" } },
// }
2.11.0

1 year ago

2.12.0

1 year ago

2.12.3

1 year ago

2.12.1

1 year ago

2.12.2

1 year ago

2.10.1

1 year ago

2.10.2

1 year ago

2.5.0

1 year ago

2.10.0

1 year ago

2.7.0

1 year ago

2.6.0

1 year ago

2.5.1

1 year ago

2.9.0

1 year ago

2.8.1

1 year ago

2.7.2

1 year ago

2.8.0

1 year ago

2.7.1

1 year ago

2.7.4

1 year ago

2.9.1

1 year ago

2.7.3

1 year ago

2.10.5

1 year ago

2.10.3

1 year ago

2.10.4

1 year ago

2.4.3

1 year ago

2.4.2

1 year ago

2.4.1

1 year ago

2.4.0

1 year ago

2.3.0

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.1.0

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago