I'm trying to create an `allItems` query, but I ca...
# prisma-whats-new
j
I'm trying to create an
allItems
query, but I can't find out how to leave off a where property on a query. Is there docs for the
ctx.db.query
interface somewhere?
h
ctx.db.query.items
j
thanks @huv1k! So I see there a GraphQL api, but not the JS api for how to interact with
ctx.db.query.items
I am trying to select all
I want to find the other methods defined on items, something like a
ctx.db.query.items.all()
h
return ctx.db.query.items({}, info)
for example
Copy code
return ctx.db.query.items({
      where: {
        name
      }
    })
a
@johnkpaul There are no other methods defined on it. The binding mimics the GraphQL schema of the endpoint, so every query is exposed as
ctx.db.query.[queryName](args, info)
. Args is whatever you would pass in as arguments to the query normally. The same goes for mutation and subscription.
j
@agartha ah ok, so when you say "normally", what do you mean? I am trying to find a way to query for all items with no where clause
Just fyi, this worked `
ctx.db.query.items({})
to get all of the items
but I am at a loss as to where I should find the docs for this API
h
Link what i posted you have CRUD api
there is everything
j
@huv1k the link that you sent I can find information about how to write the graphQL query
but I can't find out how to use the javascript api for it