How can I query for all items, similar to a `selec...
# prisma-whats-new
j
How can I query for all items, similar to a
select * from table_name;
with no where? I want something like
ctx.db.query.items.all()
n
try
ctx.db.query.table_name*s*()
e.g. for type `Item`:
ctx.db.query.items()
j
@nikolasburk thanks for the quick response! Sadly I get this error
Cannot read property 'where' of undefined
I think that the API requires me to pass an object that has a where property
oh, that worked as empty actually!
πŸ‘ 1
ctx.db.query.items({where: {}})
@nikolasburk thanks! is there a particular place in the docs that I should be looking for to see where this API is described?
n
does
ctx.db.query.items({})
also work?
j
yes, that works too
πŸ™Œ 1
n
awesome πŸ™‚
j
yeah, pretty excited. Thanks!
am I missing this in the docs, or is this just still being worked on
this meaning the documentation for this API
n
the graphcool-binding docs are a bit hidden and also still WIP, but there is some documentation to look at: https://www.graph.cool/docs/1.0/reference/advanced/graphcool-binding-ag2ahrohyi
πŸ‘πŸΎ 1
j
Thanks! that's super helpful
I tried to find that page for like an hour πŸ˜„
n
sorry about that! we’ll place it more prominently so that it’s easier to find in the future! πŸ™‚
j
no problem, I totally get that it's a WIP. In general I'm really happy with how easy it is
I think specifically wrt me not finding this particular doc is that it didn't occur to me that it would be under "advanced"
because I assumed the query API would be a normal thing people would need