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

[NTV-174 & NTV-175]: fetch faq & environmentCommitment from GraphQL #1400

Merged
merged 50 commits into from Sep 20, 2021

Conversation

Arkariang
Copy link
Contributor

@Arkariang Arkariang commented Sep 18, 2021

📲 What

  • Query Faq and add it to the project data model for future work
  • Query EnvironmentalCommitment and add it to the project data model for future work

🛠 How

  • 2 new fragments
  • added the two new fragments to fullProject fragment
  • ProjectFaq new model created
  • EnvironmentalCommitment new model created
  • Project.java model has two new fields :projectFaqs: List<ProjectFaq>, .envCommitments: List<EnvironmentalCommitment>
  • 2 new package level functions to convert GraphQL data in our DataModels
  • Tests for the new models
  • Tests for the transformers

👀 See

  • You can see here how the project retrieved from GrapQL now includes the faq's and environmental commitment fields

Screen Shot 2021-09-17 at 5 15 34 PM

| | |

📋 QA

ℹ️ We should start moving all the transformer private methods inside KSApolloClient into the new fileGraphQLTransformers.kt to be tested 😄 let me know if any concern/doubts on it

  • No user facing changes yet, but if you want to do some QA here put a breakpoint on ProjectViewModel on the currentproject observable and map the two new fields :)

Story 📖

NTV-174
NTV-175

@codecov
Copy link

codecov bot commented Sep 18, 2021

Codecov Report

Merging #1400 (a5d5bec) into master (e351b69) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1400   +/-   ##
=========================================
  Coverage     72.22%   72.22%           
  Complexity      739      739           
=========================================
  Files           211      211           
  Lines          6071     6071           
  Branches        391      391           
=========================================
  Hits           4385     4385           
  Misses         1549     1549           
  Partials        137      137           
Impacted Files Coverage Δ
.../src/main/java/com/kickstarter/models/Project.java 60.31% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e351b69...a5d5bec. Read the comment docs.

@Arkariang Arkariang marked this pull request as ready for review September 18, 2021 00:42
@@ -1169,11 +1158,13 @@ private fun projectTransformer(projectFragment: FullProject?): Project {
.staticUsdRate(staticUSDRate)
.usdExchangeRate(usdExchangeRate)
.updatedAt(updatedAt)
// .unreadMessagesCount() TODO: unread messages can be fetched form the User Object
// .unseenActivityCount() TODO: unseen activity can be fetched form the User Object
// .unreadMessagesCount() unread messages can be fetched form the User Object
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Do we need this commented out code? If not we should remove it, unless it's providing context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's for providing context, as those fields have value when fetched from V1, but on GraphQL they do not exist under Project

Copy link
Contributor

@leighdouglas leighdouglas left a comment

Choose a reason for hiding this comment

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

Awesome! Lgtm! 🚀

Base automatically changed from feature/NTV-181-project-from-graphql to master September 20, 2021 17:45
@Arkariang Arkariang merged commit f853723 into master Sep 20, 2021
@Arkariang Arkariang deleted the imartin/ntv-173-faq-environment-risks branch September 20, 2021 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants