Where

Use the where argument, on Node definitions, to conceptually append predicates to the Cypher WHERE clause. Given the current user ID is "123" and the following the schema;

type User {
    id: ID
    name: String
}

extend type User @auth(rules: [{ where: { id: "$jwt.id" } }])

Then issues a GraphQL query for users;

query {
    users {
        id
        name
    }
}

Behind the scenes the user’s ID is conceptually prepended to the query;

query {
    users(where: { id: "123" }){
        id
        name
    }
}

Where is used on the following operations;

  1. read

  2. update

  3. connect

  4. disconnect

  5. delete