Models named Query cause an internal GraphQL Parse Error #8153
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/client
Issue for team Client.
topic: engine
topic: Prisma's GraphQL protocol
Prisma Client ↔ Query Engine communication protocol for queries
topic: reserved words
See https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#naming-conventions
Milestone
Bug description
When naming models any case of
query
, no operations can be performed. Originally discovered on an actual project of mine, and discussed with @janpio. Initial suspicion was that this was due to the actual content of my query, but once I managed to troubleshoot the begun, the name of the variable (which fixed the problem) became my theory.Further confirmed by an extremely simple model with just one field producing the exact same error.
How to reproduce
Setup a basic prisma project using NPM. This means the standard:
Just use a simple sqlite3 database, it won't even query the DB because it'll crash first.
Expected behavior
This should work, and not cause this query error, or there should at least be a more descriptive error message which is specific to this error and indicates the troubleshooting step. The standard error (below) is totally useless.
If the decision is made not to correct this behaviour, this should be documented.
Prisma information
Prisma Schema:
Test Code:
with package.json:
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: