metrumresearchgroup / ghpm

BSD 3-Clause Clear License
1 stars 0 forks source link

explore mocking get_query_results vs graphql_query #8

Closed dpastoor closed 4 years ago

dpastoor commented 4 years ago

do they behave differently? can you use either one fine or does one not work?

Blackglade commented 4 years ago

Mocking either function doesn't cause any difference in behavior. I realized however why I was mocking graphql_query instead of get_query_results.

get_query_results drills down several keys to get to the list of nodes and returns that relevant node data to the calling function. graphql_query doesn't. At the time, if I were to mock get_query_results instead, I would've had to manually edit the original response from Github and remove any unnecessary keys. Mocking graphql_query I didn't have to do that.