-
Notifications
You must be signed in to change notification settings - Fork 447
2. Front end
virginieky edited this page Apr 29, 2019
·
14 revisions
This project is an example to help you structure your projects using production-ready technologies.
Live demo : https://foodadvisor.strapi.io/
- React - (UI Framework)
- React Router - (Routing)
- GraphQL - (Web Data API)
- Apollo - (GraphQL Client)
- Styled Components - (ES6/CSS style)
- ESLint - (JS Best Practices/Code Highlighting)
- Jest - (Tests)
- Restaurant
- Restaurant
- About us
You can see all GraphQL queries in /src/queries/
.
In the /src/queries/restaurant.js
you will see how to make a simple GET request to render a restaurant by ID.
📚GraphQL schema configuration documentation here.
In the /src/queries/restaurants.js
you will see how to make a GET request using filter params on restaurants.
📚Filters documentation here.
To add custom behaviors as connections, you can update your API schema.
📚GraphQL Aggregation grouping documentation here.
Example: Retrieving the reviews average of a restaurant
{
restaurant(id: $id) {
id
name
reviews {
id
note
content
created_at
author {
username
picture {
url
}
}
}
}
reviewsConnection(where: { restaurant: $id }) {
aggregate {
count
}
}
}
You can find out how to setup and run FoodAdvisor client in the Readme