Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pal won't generate arguments when model name is lowercase #255

Open
renaldasrep opened this issue Feb 24, 2022 · 1 comment
Open

pal won't generate arguments when model name is lowercase #255

renaldasrep opened this issue Feb 24, 2022 · 1 comment

Comments

@renaldasrep
Copy link

renaldasrep commented Feb 24, 2022

Example schema:

datasource db {
  provider = "sqlite"
  url      = env("DATABASE_URL")
}

generator client {
  provider        = "prisma-client-js"
}

model Item1 {
  id        Int       @id @default(autoincrement())
}

model item2 {
  id        Int       @id @default(autoincrement())
}

graphql/Item1/queries/findUnique.ts

import { queryField, nonNull } from 'nexus'

export const Item1FindUniqueQuery = queryField('findUniqueItem1', {
  type: 'Item1',
  args: {
    where: nonNull('Item1WhereUniqueInput'),
  },
  resolve(_parent, { where }, { prisma, select }) {
    return prisma.item1.findUnique({
      where,
      ...select,
    })
  },
})

compared to:

graphql/item2/queries/findUnique.ts

import { queryField, nonNull } from 'nexus'

export const Item2FindUniqueQuery = queryField('findUniqueItem2', {
  type: 'item2',

  resolve(_parent, { where }, { prisma, select }) {
    return prisma.item2.findUnique({
      where,
      ...select,
    })
  },
})
@renaldasrep renaldasrep changed the title pal won't generate arguments when using mysql provider pal won't generate arguments when model name is lowercase Feb 24, 2022
@renaldasrep
Copy link
Author

upon further investingation I found that the original issue is not what I thought it was, so I updated the name and description
thankfully I can work around this quite easily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant