menu

Apollo

A community of developers, designers and others who love Apollo and GraphQL. 🚀

Channels
# All channels
view-forward
# General
view-forward
# Apollo Angular
view-forward
# Announcements
view-forward
# Apollo Android
view-forward
# Apollo Client
view-forward
# Apollo iOS
view-forward
# Apollo Link
view-forward
# Apollo Link Rest
view-forward
# Local State
view-forward
# Apollo Studio
view-forward
# Apollo Server
view-forward
# Apollo Tooling
view-forward
# Contributing
view-forward
# Docs
view-forward
# Events
view-forward
# GraphQL Tools
view-forward
# Jobs
view-forward
# Random
view-forward
# React Apollo
view-forward
# Showcase
view-forward
# Subscriptions
view-forward
# Testing
view-forward
# Vue Apollo
view-forward
Team

Best place to store and call Apollo Queries in Angular App?

June 24, 2020 at 5:43pm

Best place to store and call Apollo Queries in Angular App?

June 24, 2020 at 5:43pm
i'm working on an app using angular on the front end, with angular apollo connecting to an node/apollo graphql server. the graphql server works with a mongodb backend.
my question is where in my angular app is the best place to fire my apollo graphql queries? I currently am planning to store the queries themselves in the relevant service (aka store.service, blog.service, etc). Then i call the appropriate query on my view components with ngOnInit. The views then pass the data down via () to the components that are rendered in that view.
Is this a good pattern? Am I missing something obvious?
No messages yet