Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace and remove loadBasicLesson #1139

Merged
merged 4 commits into from
Jul 20, 2022

Conversation

jbranchaud
Copy link
Collaborator

@jbranchaud jbranchaud commented Jul 15, 2022

guiding issue: #1138

  • refactor: add 4 missing attrs to loadLesson gql
  • refactor: do logical rearrangement of lesson attrs
  • refactor: replace loadBasicLesson w/ loadLesson

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.

Here is the commit (7e4ce03) that originally introduced the loadBasicLesson function. Since then a handful of attributes have been added to it. @joelhooks, let me know if I'm missing some important context for why this separate query was originally added.

basic

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
@vercel
Copy link

vercel bot commented Jul 15, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
egghead-io-nextjs ✅ Ready (Inspect) Visit Preview Jul 20, 2022 at 6:51PM (UTC)
egghead-next-storybook ✅ Ready (Inspect) Visit Preview Jul 20, 2022 at 6:51PM (UTC)

Comment on lines +54 to +55
updated_at
published_at
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there are more changes here than there actually are. This primary adds:

  • updated_at
  • published_at
  • playlist.lesson[].media_url
  • course.lesson[].media_url

And then the rest is logically rearranging/grouping the attributes.

Copy link
Contributor

@joelhooks joelhooks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this approach is solid and makes sense to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants