This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
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.
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!
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.
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]}])
ahhh thanks for updating here, will be helpful for me when I try 😄
@U0EFQAS4B I just stopped to have a look, but seems like you got it figured out, is there still any issue blocking you?
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.
patched pathom3-graphql? or something in your end?
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.
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