GraphQL: Only returns one item? #373
-
To preface: this is my first foray into querying graphQL, but it's the only way to get the data that i'd like without flooding the server with 1,000 requests everytime the app spins up. Issue: Querying the GraphQL interface (even via Postman, etc.) only seems to return one single item/entry, compared to the equivalent REST API path. ... is there something that i'm doing wrong here? (my actual desired query is much more complex, this was just an example showing that graphql is listing just a single entry by comparison) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You need the Try this: query Equipment {
equipments {
index
name
desc
weight
}
} There's a "GraphQL Fundamentals" tutorial in our new docs if you want a quick primer on GraphQL: https://5e-bits.github.io/docs/docs/tutorials/beginner/graphql |
Beta Was this translation helpful? Give feedback.
You need the
equipments
if you want to fetch a list of items! All the plural root fields are collections, and all the singular fields are individual documents.Try this:
There's a "GraphQL Fundamentals" tutorial in our new docs if you want a quick primer on GraphQL: https://5e-bits.github.io/docs/docs/tutorials/beginner/graphql