{"repo":"devoxa/prisma-relay-cursor-connection","free":true,"listed":false,"github":"https://github.com/devoxa/prisma-relay-cursor-connection","clone":"git clone https://github.com/devoxa/prisma-relay-cursor-connection.git","description":"Extend Prisma's `findMany` method to support Relay Cursor Connections","language":"TypeScript","stars":272,"topics":["prisma","prisma2","prisma-client","relay","cursor","pagination","graphql","hacktoberfest"],"license":null,"category":"api-integrations-sdks","readme_excerpt":"prisma-relay-cursor-connection Extend Prisma's findMany method to support Relay Cursor Connections Installation • Usage • Contributing • Contributors • License Installation This module has a peer dependency on @prisma/client . You can check the supported versions in the package.json ( peerDependencies ). Usage General Usage This module validates the connection arguments to make sure they work with Prisma. The following combinations are supported: - {} All resources - { first: number } The first X resources - { first: number, after: string } The first X resources after the id Y - { last: number } The last X resources - { last: number, before: string } The last X resources before the id Y Two cases need to be checked in your code if you are passing in user-provided data to prevent the user from reading out too many resources at once: - One of first last has to be defined - first last have to be below a reasonable maximum (e.g. 100) Type-Safe Arguments You can also use additional FindManyArgs while keeping type safety intact: Custom Cursors By default, the cursor is the id field of your model. If you would like to use a different field, a compound index, or handle encoding/decoding, you can pass the following options: You can find more examples for custom cursors in the unit tests. Custom Edges & Nodes By default, the edge consists of the cursor and the node . If you would like to add additional fields to the edge or the node, you can pass the following option: Out-of-the box th","default_branch":null,"files":null,"tree":[],"storefront":"/r/devoxa","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/devoxa/prisma-relay-cursor-connection/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}