Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Antony-Figueroa/my-evershop-app/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
GraphQL queries allow you to fetch data from your EverShop application. This page documents all available queries across the application’s extensions.Query Structure
Queries in EverShop follow the standard GraphQL query syntax:Sample Extension Queries
The sample extension demonstrates basic query patterns with theFoo type.
Query: foo
Fetch a single Foo object by ID.
The unique identifier of the Foo object
Returns a Foo object or null if not found
Query: foos
Fetch all Foo objects.
Returns an array of all Foo objects (never null)
Product Extension Queries
The productCatalog extension extends the coreProduct type with supplement-specific data.
Extended Type: Product
When querying products, you can access supplement information through the extension field.
Additional product data extensions
Query Examples in Components
Here’s how to use GraphQL queries in page components:Basic Query Example
extensions/sample/src/pages/frontStore/fooList/FooList.tsx
Query with Arguments
Query Best Practices
Request Only What You Need
Only query the fields you actually need to reduce data transfer and improve performance.
Use Fragments
Use GraphQL fragments to reuse common field selections across multiple queries.
Handle Null Values
Always check for null values in your components when fields are nullable.
Use Variables
Use query variables instead of string interpolation for dynamic values.
Error Handling
Queries can return errors in the response:Always check both the
data and errors fields in the GraphQL response.Creating Custom Queries
To add a new query to your extension:-
Define the query in your GraphQL schema:
-
Implement the resolver:
-
Use it in your components:
Next Steps
GraphQL Mutations
Learn how to modify data with mutations
GraphQL Overview
Review GraphQL architecture and concepts