pathom

grant 2024-01-20T19:46:01.014349Z

Does anyone have an example doing mutations with pathom3-graphql? Maybe it’s in the docs and I’m just missing it, but I haven’t been able to figure out how to make it work yet.

Tyler Nisonoff 2024-01-20T21:29:53.684599Z

do these docs help at all? https://pathom3.wsscode.com/docs/integrations/graphql#mutations Haven't tried it yet, but found these helpful for reads!

grant 2024-01-21T00:52:06.627709Z

Thanks for the pointer Tyler. Unfortunately, they pretty much describe what I’m doing. The only difference I see it that I am quoting the list form so Clojure doesn’t try to evaluate it as a function.

wilkerlucio 2024-01-23T00:12:01.642959Z

@grant I just stopped to have a look, but seems like you got it figured out, is there still any issue blocking you?

grant 2024-01-23T00:23:00.406719Z

No, no blockers at the moment. I am able to move forward with my patched version of the library and calling the mutations as described.

wilkerlucio 2024-01-23T00:23:40.184019Z

patched pathom3-graphql? or something in your end?

grant 2024-01-23T00:25:03.423469Z

pathom3-graphql I had to fix it to be able to call p.gql/connect-graphql without crashing. But it’s more a hack to get it working that a real fix.

grant 2024-01-23T00:26:17.478179Z

Happy to send it to you if you want it though.

wilkerlucio 2024-01-23T00:27:13.014539Z

sure, I would like to see, happy to check a PR, and we can work together on the real fix, I like to see what you had to change

👍 1
grant 2024-01-21T18:24:37.962699Z

So, I eventually figure out what was going wrong. One problem I had, was sending an enum type value as a string. GraphQL did not like having the value in quotes. The other thing I found necessary to make mutations work was to not use the mutation by itself. I had to ask for some value back or it would blow up. So, this works,

(p.eql/process
  env
  [{`(gql.Mutation/createComputingDeviceAsset {:input {:name "CoolName" :asset_type computing_device}})
    [:gql.ComputingDeviceAsset/name]}])
But, this,
(p.eql/process
  env
  [`(gql.Mutation/createComputingDeviceAsset {:input {:name "CoolName" :asset_type computing_device}})])
And, this, do not.
(p.eql/process
  env
  [{`(gql.Mutation/createComputingDeviceAsset {:input {:name "CoolName" :asset_type "computing_device"}})
    [:gql.ComputingDeviceAsset/name]}])

Tyler Nisonoff 2024-01-21T19:42:28.214619Z

ahhh thanks for updating here, will be helpful for me when I try 😄