Coder Social home page Coder Social logo

Comments (8)

jaaneh avatar jaaneh commented on May 23, 2024 1

@jaaneh Can you test 0.4.2?

0.4.2 works! 🎉 Thank you for fixing so quickly.

from prisma-extension-pagination.

jaaneh avatar jaaneh commented on May 23, 2024

Actually, using a setup like this seems to work, but adding it to all models is causing issues.

import { PrismaClient } from "@prisma/client"
import { paginate } from "prisma-extension-pagination"

const prismaClient = new PrismaClient()
const prisma = prismaClient.$extends({
  model: {
    book: {
      paginate
    }
  }
})

export default prisma

from prisma-extension-pagination.

jaaneh avatar jaaneh commented on May 23, 2024

Also going to hijack my own issue to ask if it's possible to add config globally. For example, I want to add includePageCount: true as default to all responses, and instead disable it for the few where I may not want it.

from prisma-extension-pagination.

deptyped avatar deptyped commented on May 23, 2024

Hi, it looks like a problem with module resolution. Can you provide your tsconfig?

Also going to hijack my own issue to ask if it's possible to add config globally. For example, I want to add includePageCount: true as default to all responses, and instead disable it for the few where I may not want it.

No, this is not implemented yet.

from prisma-extension-pagination.

jaaneh avatar jaaneh commented on May 23, 2024

Hi, it looks like a problem with module resolution. Can you provide your tsconfig?

Sure. Here you are

{
  "compilerOptions": {
    "module": "commonjs",
    "allowSyntheticDefaultImports": true,
    "target": "esnext",
    "noImplicitAny": true,
    "esModuleInterop": true,
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "sourceMap": true,
    "outDir": "dist",
    "baseUrl": "src",
    "strict": true,
    "typeRoots": ["types"]
  },
  "include": ["src/**/*", "types"],
  "exclude": ["node_modules"]
}

from prisma-extension-pagination.

deptyped avatar deptyped commented on May 23, 2024

@jaaneh Can you test version 0.4.1? Should be fixed now

from prisma-extension-pagination.

jaaneh avatar jaaneh commented on May 23, 2024

Can you test version 0.4.1? Should be fixed now

Unfortunately looks like it's still an issue. I'm extending all to get around it for now.

import { PrismaClient } from "@prisma/client"
import { paginate } from "prisma-extension-pagination"

const prisma = new PrismaClient().$extends({
  model: {
    $allModels: {
      paginate
    }
  }
})

from prisma-extension-pagination.

deptyped avatar deptyped commented on May 23, 2024

@jaaneh Can you test 0.4.2?

If still not working please check this minimal reproducible example, works for me
https://github.com/deptyped/prisma-extension-pagination-issue-11

from prisma-extension-pagination.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.