---
# System prepended metadata

title: 'myCorporation query refactoring - Mon 22nd March, 2021'
tags: [graphene, kubernetes, newrole, programmingjournal, '2021', print]

---

# myCorporation query refactoring - Mon 22nd March, 2021

Bit quiet on my part with these public diaries recently. About three weeks ago, I started a new role at a new company, and have so far simply been learning the ropes!

I'll continue to use TypeScript and React Native (as well as some occassional React web work) and native tooling and infrastructure, while also working more server-side using Python and Django with [Graphene](https://github.com/graphql-python/graphene) to create GraphQL APIs, as well as (hopefully) getting to do more cloud development on AWS.

Yesterday, I started working on refactoring an existing GraphQL query to accomodate both corporations (AKA larger businesses) and smaller, independent businesses to use a single, unified query to fetch that business's info.

A few things I learnt:

I was trying to hunt in the code for where the GraphQL resolver is talking to the Django model.
The GraphQL `operationName` for this query was "myCorporation".

In Graphene, all resolvers for queries need `resolve_` prepended, as well as using snake_case that Graphene converts to camelCase under the hood. So an easy way to find where in the code this resolver lived was simply to search for `resolve_my_corporation`.

I also continue to discover more things about Python to make my life easier. [vars()](https://www.programiz.com/python-programming/methods/built-in/vars) was a way I discovered to print the response from the Django model.

I took a couple of hours to attend a cool Kubernetes for JS Devs workshop, which was useful. 

###### tags: `programmingjournal` `2021` `kubernetes` `graphene` `print` `newrole`