Nexus-plugin-prisma: Feature Request: trivial- standardize pascal cased queries and mutations with Prisma 2

Created on 27 Sep 2019  路  2Comments  路  Source: graphql-nexus/nexus-plugin-prisma

There appears to be a discrepancy in the naming convention between queries and mutations for pascal-cased models.

Scenario:

Imagine a model called ExecutionLog in Prisma 2:
model ExecutionLog { id String @default(cuid()) @id @unique createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

When I'm using that with nexus, I see that it generates the following queries and mutations:

t.crud.createOneExecutionLog(); t.crud.deleteOneExecutionLog(); t.crud.updateOneExecutionLog();

The discrepancy comes in the queries section where it changes the case of the L from upper to lowercase. This means that the queries have a lowercase l which means that if I want to preserve the same case I have to do the following:

t.crud.executionlogs({ alias: 'executionLogs' }); t.crud.executionlog({ alias: 'executionLog' });

I'm not arguing for the upper or lower case L here, but I'm just saying that it might be less confusing if we kept the same convention in both the queries and mutations. This is definitely a small trivial issue but I thought I'd point it out.

impacmedium scopprojecting typbug

Most helpful comment

Ooops, you're right @CaptainChemist. We should fix this ASAP as it'll result in a breaking change. Adding that to our sprint 馃檹 cc @jasonkuhrt

All 2 comments

Ooops, you're right @CaptainChemist. We should fix this ASAP as it'll result in a breaking change. Adding that to our sprint 馃檹 cc @jasonkuhrt

Marking this as medium impact as there is a clear workaround. High impact would be security or crash affecting many users in most situations, a problem that cannot be worked around, and so on.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryands17 picture ryands17  路  5Comments

franjohn21 picture franjohn21  路  4Comments

aqwert picture aqwert  路  3Comments

mohe2015 picture mohe2015  路  3Comments

jasonkuhrt picture jasonkuhrt  路  4Comments