-
Notifications
You must be signed in to change notification settings - Fork 447
2. Front end
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.
Documentation link https://strapi.io/documentation/guides/graphql.html#configurations
In the /src/queries/restaurants.js you will see how to make a GET request using filter params on restaurants.
Documentation link https://strapi.io/documentation/guides/filters.html
To add custom behaviors as connections, you can update your API schema.
Documentation link https://strapi.io/documentation/guides/graphql.html#aggregation-grouping
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
}
}
}
cd client````
npm install
npm start```
And visit http://localhost:3000/.
npm test
npm build
npm run generate