In the end I managed to realise that I just need to create an endpoint and connect the twig template directly to endpoint using ajax, in the same way I would for rest API’s. I am using the GraphQL Bundle for Symfony and I updated the endpoint by changing the config/routes/graphql.yaml file to the following:
overblog_graphql_endpoint: resource: "@OverblogGraphQLBundle/Resources/config/routing/graphql.yml" prefix: /graphdata
I am still learning, so go easy on me.
Read more here: Source link