The goal of the following piece of code is to create a dictionary that is populated with data received from GraphQL query responses. Manager list is constructed as the following: managers_list: [‘manager1@email.com’, ‘manager2@email.com’] The “get_employees_per_manager” fun…
Tag: graphql
How to mock functions with same name, when called twice?
How do I mock a function which has been called twice in the same file, with different parameters? Here is my code snippet: code_file.py code_test.py First mock call to graphql is succeeding. The second graphql call is not getting mocked. It is trying to contact the actual server and receiving 404. How can I m…
GraphQL Query String Formatting in Python
Background I am working on a project to fetch data from GitHub repositories using GitHub’s GraphQL APIv4. I am facing an issue to format the query string for passing the values of the username and …
How to use a django abstract class with graphene-django?
I’m trying to have a unique interface for two concrete classes that are similar and inherit from a common abstract class. My django model classes: My graphene-django api: When querying the graphql mutation corresponding to CreateMetadata, the metadata concrete class is successfully created. ;-) The prob…
Error in graphQL python example code
I am starting working on GraphQL and as I am from python background I am using GraphQL with Python. I followed the steps provided here Link but I am still facing issues. Please, help me resolve the issue. Answer You are not giving much information here, maybe the code that triggers the error would be helpful,…
GitHub GraphQL API Problems parsing JSON
What is wrong here? I’ve got but this snippet of code below works correctly I’ve tried out to change quotes (from ” into ‘ or with ” and so on) but it doesn’t work. Answer The problem is related with the double quotes (“). On the first snippet, when you join the ̵…