This project shows how to to build a simple Angular app using the wagtail-graphql app.
This repo shows how to:
- Request page information from wagtail-graphql as a route fallback
- Load regular Angular pages that rely on the GraphQL API to get data from Wagtail
The points above mean that Angular will try to match any route using the typical route matching, but instead of falling back to a static page, it dynamically creates the route match if the url exits in Wagtail.
This project relies on the test wagtail project that is part of the wagtail-graphql library. It can be found here. To run the Wagtail server:
python manage.py runserverWhile the Wagtail server is running, launch this app with
yarn startor, npm start if you use npm. The two commnads above servet the website at http://localhost:4200/ and the GraphiQL in-browser IDE at http://localhost:8000/graphiql
The project relies on Angular CLI -- all the typical instructions using the ng command still aplly.