Skip to content
Advertisement

Tag: graphql

Dynamically generate a dictionary with GraphQL response values as key names

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” function takes a list of managers and a token, then it returns a list of employees and their actions. “execute_query” function executes the given query

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 mock both graphql client calls? Answer

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, but googling I found

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 ‘{“query”: “‘+query+'”}’ with the query variable, you get

Advertisement