Prisma1: Error when using prisma.$exists

Created on 12 Sep 2018  路  2Comments  路  Source: prisma/prisma1

Describe the bug
When using the prisma.$exists method, prisma-client-lib throws an error.

To Reproduce
Steps to reproduce the behavior:

  1. Set up the example: https://github.com/prisma/prisma-examples/tree/master/typescript-graphql
  2. Change a resolver to use $exists, for example Query.ts:
export const Query: IQuery.Resolver<Types> = {
  masters: async (root, args, ctx) => {
    const exists = await ctx.db.$exists.master({ id: "test" });
    console.log(exists);
    return ctx.db.masters();
  }
};
  1. Start server, and run the masters query.
  2. See error:
Error: Invalid exist query: masters
    at Object.buildExistsInfo (/Users/.../prisma-examples/typescript-graphql/node_modules/prisma-client-lib/src/info.ts:289:11)

Expected behavior
To console log a boolean and continue within the resolver.

Versions (please complete the following information):

  • Prisma CLI: prisma/1.17.0-beta.2 (darwin-x64) node-v8.11.4
  • Prisma Server: 1.17-beta-1
bu2-confirmed areclients

All 2 comments

Fixed via https://github.com/prisma/prisma/commit/cd53fc8eba010df60c56f3b5c9131ed12392e3ed

I can confirm that I am no longer able to reproduce. This is available in the latest beta npm install -g prisma@beta.

This is now in stable (1.17). Please use npm install -g prisma to update the CLI.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikolasburk picture nikolasburk  路  3Comments

thomaswright picture thomaswright  路  3Comments

marktani picture marktani  路  3Comments

jannone picture jannone  路  3Comments

dohomi picture dohomi  路  3Comments