I am more of a beginner with graphql and a bit confused between learning the basics and how Gatsby uses it to import all data for its static site needs. And wanted to know what might be best practice when it comes to my situation.
I have two content types setup in GraphCMS. {Content type A} links to {Content type B} in a one to many relationship. And in my site I have a few places where I want a list of A that shows the links to B in them and visa versa.
I would love any ideas on what might be the best way to go about making this data available when its imported from Graphcms on build startup/generation of pages. I could just reference all fields twice (using fragments?) in the configs query. Or do I query each the list of a and b separate and have a field reserved for their id and then in gatsby-node attach their linked items matching their ids. Alternatively it could be done at on client side but I imagine i should take full advantage of the generator tools?
Any and all help is greatly appreciated.
___NODE
, incase you don't know. Here's an example