Prisma1: Executing a Raw mutation without `rawAccess: true` returns a cryptic error message

Created on 31 Oct 2018  路  3Comments  路  Source: prisma/prisma1

Describe the bug

  • Using the MySQL connector
  • Prisma 1.19
  • No rawAccess set in docker-compose.yml

Execute this:

mutation {
   executeRaw(query: "SELECT * FROM `default@default`.`User`")
}

Returns this error:

ERROR: syntax error at or near \"\"\n Position: 15",`

bu2-confirmed areserver

All 3 comments

This should indeed return a clearer error message.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

This now returns a Sangria query validation error letting the user now that the field executeRaw is not available. This is probably clear enough?

{
  "data" : null,
  "errors" : [ {
    "message" : "Cannot query field 'executeRaw' on type 'Mutation'. (line 3, column 4):\n   executeRaw(query: \"SELECT * FROM `default@default`.`User`\")\n   ^",
    "locations" : [ {
      "line" : 3,
      "column" : 4
    } ]
  } ]
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ragnorc picture ragnorc  路  3Comments

MitkoTschimev picture MitkoTschimev  路  3Comments

marktani picture marktani  路  3Comments

akoenig picture akoenig  路  3Comments

marktani picture marktani  路  3Comments