Queries
Queries are the read side of your GraphQL API. Each field in your Query type has a resolver — an async function that fetches and returns data.Writing Resolvers
A resolver receives aPrismGraphQLResolveInfo with everything it needs:
Resolver Context
Simple Query
Hello World Query
Queries with Arguments
Pass arguments to filter, paginate, or customize results:Query with Arguments
Multiple Arguments
Filtering and Pagination
Nested Object Resolution
When a field returns an object type, the executor resolves its sub-fields using the returned value asparentValue:
Nested Resolution
Introspection
Prism’s executor handles__typename, __schema, and __type introspection queries automatically. Clients (like GraphiQL) use these to discover your API:
Introspection is always enabled. In production, you might want to disable it — a future version of Prism will add a config flag for this.
Error Handling
Resolvers can throw errors. The executor catches them per-field and includes them in the response while still returning data for other fields:Partial Errors
What’s Next
Mutations
Learn how to modify data through GraphQL
Playground
Set up the interactive GraphQL playground