Readit News logoReadit News
kualto commented on Experiments in Making Cocktail Ice   alcademics.com/index-of-i... · Posted by u/mhb
kualto · 3 years ago
I always thought the key to getting clear ice was to boil the water first so the oxygen goes out of solution.
kualto commented on An Honest Review of Gatsby   cra.mr/an-honest-review-o... · Posted by u/ehfeng
zeeg · 5 years ago
You're extremely limited in what you can compile as a GraphQL query, so while yes I agree with you that likely there is some stuff we're simply doing wrong.. good luck doing it right. After all, its a database query language trying to create a giant cache of its results.

For example, we have what roughly amounts to an <Include> component. It uses some contextual information to include language-specific code. That include component pulls in a markdown file from disk based on 1) the includePath you set, and 2) the language selected. In order to make this function, we have to pull in _all_ possible includes within the static query, and then filter it down to the ones we need. There is literally no better way we could do this, because static queries are exactly that - static. There is no fixing this problem because the design of this data layer is broken by default.

kualto · 5 years ago
Have you tried using page queries? Page queries can accept arguments passed in via the createPage API. Here's some (admittedly hard to find) documentation about it: https://www.gatsbyjs.com/docs/page-query/#how-to-add-query-v...

The basic idea is your page context just contains identifiers for the content you need to display on the page and then the page query uses those identifiers to query for just those objects and request all the properties of those objects that the page needs.

u/kualto

KarmaCake day280March 31, 2020View Original