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

Code duplication - GraphQL queries #767

Open
raghunath-r-a opened this issue Sep 27, 2021 · 3 comments
Open

Code duplication - GraphQL queries #767

raghunath-r-a opened this issue Sep 27, 2021 · 3 comments

Comments

@raghunath-r-a
Copy link
Collaborator

GraphQL queries are duplicated at many places in the templates.

Please remove those duplicate queries to help improve code quality.

@aloks98
Copy link

aloks98 commented Sep 30, 2021

@raghunath-r-a Hey! I can work on this as I have exp with graphql. Can I get some info what kind of queries we are looking at?

@abhir9 abhir9 linked a pull request Oct 1, 2021 that will close this issue
@raghunath-r-a raghunath-r-a removed a link to a pull request Oct 1, 2021
@mohammed786
Copy link
Collaborator

Hi, @aloks98 Below is the frontmatter format that will be used for Graphql queries:

---
title: "<Title>"
date: "2017-04-07"
coverImage: "<relative path>"
author: "<Author id which is linked to the author.yaml file>"
tags: ["Engineering","JavaScript","Hacks","Array"]
description: "<Short description>"
pinned: <boolean - used to showcase the blog at the top>
---

From the above frontmatter we are:

  • Listing the blog based on the date (recent first)
  • If there is any blog that has pinned: true it should show at the top else the latest blog should show at the top.
  • Filter blogs based on tags
  • Filter blogs based on the author

So the queries are written for the above filters, it has the scope of optimization, you can go ahead and have a look at the queries and let me know your thoughts on it and how we can improve the performance by modifying it.

Thanks !!!

@raghunath-r-a
Copy link
Collaborator Author

Hi @aloks98 This is now assigned to you. You may go ahead and work on this.

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

No branches or pull requests

3 participants