You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of trying to understand what attributes and associated data we need when loading a Lesson for a lesson page, I compared and contrasted the loadLesson and loadBasicLesson graphql queries that appear in src/lib/lessons.ts.
I'll summarize my findings and then reproduce the entire annotated queries.
Headline
The headline for me is that I think we can make a couple (4) small adjustments to the loadLesson function for all our needs and then throw away the loadBasicLesson function. For starters, this will reduce confusion about which to use and when. There is no way to make that decision at a quick glance because both are loading most of the kitchen sink. From here, there is probably additional trimming down and clarifying that we can do.
Summary
After doing a side-by-side comparison of the two queries, I was able to rearrange a few attributes and then add comments on both sides for the ones that were missing (annotated by """ some_attr """).
For loadLesson, the only attributes that loadBasicLesson requests that it doesn't already request are:
lesson.updated_at
lesson.published_at
collection.playlist.lesson[].media_url
collection.course.lesson[].media_url
For loadBasicLesson, they are still quite similar but it is missing a few more attributes:
We are in the process of moving away from egghead-rails as the source of
lesson metadata. This moves us along that path by eliminating one of th
huge graphql queries for lesson metadata.
issue: #1138
We are in the process of moving away from egghead-rails as the source of
lesson metadata. This moves us along that path by eliminating one of th
huge graphql queries for lesson metadata.
issue: #1138
As part of trying to understand what attributes and associated data we need when loading a Lesson for a lesson page, I compared and contrasted the
loadLesson
andloadBasicLesson
graphql queries that appear insrc/lib/lessons.ts
.I'll summarize my findings and then reproduce the entire annotated queries.
Headline
The headline for me is that I think we can make a couple (4) small adjustments to the
loadLesson
function for all our needs and then throw away theloadBasicLesson
function. For starters, this will reduce confusion about which to use and when. There is no way to make that decision at a quick glance because both are loading most of the kitchen sink. From here, there is probably additional trimming down and clarifying that we can do.Summary
After doing a side-by-side comparison of the two queries, I was able to rearrange a few attributes and then add comments on both sides for the ones that were missing (annotated by
""" some_attr """
).For
loadLesson
, the only attributes thatloadBasicLesson
requests that it doesn't already request are:lesson.updated_at
lesson.published_at
collection.playlist.lesson[].media_url
collection.course.lesson[].media_url
For
loadBasicLesson
, they are still quite similar but it is missing a few more attributes:lesson.duration
lesson.transcript_url
lesson.next_up_url
lesson.dash_url
lesson.http_url
lesson.lesson_view_url
lesson.download_url
collection.playlist.lesson[].thumb_url
collection.course.lesson[].thumb_url
lesson.course.title
lesson.course.square_cover_480_url
lesson.course.slug
lesson.repo_url
lesson.code_url
Annotated Queries
The text was updated successfully, but these errors were encountered: