Fork me on GitHub

I find debugging Pathom resolvers/mutation errors very difficult. Are there any articles or other resources that can help me?


what is current debug flow, can you tell me what kind of issue you trying to debug?


For example the issue I'm dealing with right now is in using the GraphQL GitHub integration alongside my own resolvers. I'm running into an issue where I can make a request for :github.Repository/stargazerCount, and I can make a request for :github.Repository/description, but when I make a request for both of them together like [:github.Repository/stargazerCount :github.Repository/description], the description always fails. My general approach to troubleshooting this sort of thing is to try to decompose the request into smaller parts - that's how I know that requesting the attributes individually works - and tapping inside resolvers to make sure the inputs are provided. I look at the graph in Viz as well, but at least in this particular example, I don't know how to use the visualization to solve the problem


I think understanding how to read the graph can greatly help, does the arrow and nodes in this graph make sense to you?


Yes, it kind of does. I've read over the Planner page and the debugging page before. The color legend is straightforward. So here it looks like the bottom AND node is the problem. The black arrows only go after the orange arrows go, but the nodes that the orange arrows point at are grey, meaning they didn't execute. I guess that's why the red node is there? I don't have the clearest understanding of the picture here.


the reason they don't executed is likely to be because they already ran somewhere else (duplicated node), what I would look for in this is at the red clal to pathom-entry-dynamic-resolver, if you click on it you can see the details like: what input values it used, what AST call it made


if the inputs looks wrong for example, then I start navigating back in the graph to see what the previous resolver has done


In this case, the red node is the one for description:

:com.wsscode.pathom3.connect.runner/node-resolver-input {}},
   :missing {:github.types/Repository {}},
   :required {:github.types/Repository {}}},
  "Insufficient data calling resolver 'github/pathom-entry-dynamic-resolver. Missing attrs :github.types/Repository",
The previous node is the one that gets stargazerCount:
 {:github.types/Repository {}},
 {:github.Repository/name {}, :github.User/login {}},
 :com.wsscode.pathom3.connect.planner/node-id 152,
 :com.wsscode.pathom3.connect.planner/node-parents #{190},
 :com.wsscode.pathom3.connect.planner/run-next 138,
 :com.wsscode.pathom3.connect.runner/node-done? true,
 {:github.Repository/name "pathom3",
  :github.User/login "wilkerlucio"},
 {:github.Repository/stargazerCount 111},
And I have an entrypoint which uses the repo name and owner:
::p.gql/root-entries-map {"repository" {"name"  ["Repository" "name"] 
                                        "owner" ["User" "login"]}     
It looks like stargazerCount is able to use the entrypoint, but the entrypoint does not get used for the subsequent :github.Repository/description call. Does that seem like the correct interpretation @U066U8JQJ?


yeah, looks right, this could be a bug in the graphql impl, or in the dynamic resolver in general


if you can cook a demo repro I'll be glad to take a look


yes please, in Pathom 3 repo 🙂


Okay, here it is Your Slack status says you're on vacation, @U066U8JQJ. This stuff can wait! Please enjoy your vacation and thank you for the help today.

🙏 1

@UPWHQK562 I did a fix, but I see more things to improve, if you bump pathom3-graphql to latest it should work


I add more details in the issue


@U066U8JQJ thanks very much. I'll test it in the next few days. Glad to hear you found more areas for improvement. The GraphQL integration stuff feels a bit like magic when everything is working. If there's any testing or intel I can provide please let me know.


@UPWHQK562 just got the new optimizations in! check what the graph looks like now 🙂


@U066U8JQJ now that's a much cleaner picture :) looking forward to making use of this. Thanks!