Fork me on GitHub
#pathom
<
2019-02-07
>
liesbeth10:02:47

Hi! I was looking at connecting graphql as a fulcro remote. It seems to load the schema now, but I cannot explore what resolvers/queries are now available, does anyone have suggestions on how to find that out?

liesbeth10:02:35

I found a solution! Probably the rest of the world already knew this, but if you press the grey circle left of ‘Run query’ in the Fulcro Inspector Query tab, it will give you suggestions on what you can query 🙂

👍 10
wilkerlucio12:02:42

@liesbeth exactly, maybe we should somehow try to make that more obvios, in the first versions it used to load it automatically, but that was a problem for people not using pathom

wilkerlucio12:02:53

just not sure how, but I'm open to design ideas 🙂

liesbeth12:02:27

Okay. If I think of anything I’ll let you know 😉

liesbeth12:02:16

I actually also have another question: in the documentation about graphQL it says ” Name munging is customizable via Pathom settings.” How would that work? I am using a graphql endpoint that has query and mutation names capitalized, and am not sure how to change this is pathom.

wilkerlucio12:02:18

@liesbeth trying to remember, I know there is a flag for that, try setting :com.wsscode.pathom.graphql/js-name (its a fn that receives a string, you can use identity for no change) in the graphql settings

wilkerlucio12:02:24

humm, but looking at the sources I'm not sure if thats true for the connect integration, we may need to change some code to fix that, the js-name works on the simple integration, but it should work for connect too, just seems you are first to stumble on it

wilkerlucio12:02:30

capitalized is the default in graphql, pathom converts it to kebab case to be more clojure friendly

wilkerlucio12:02:41

but I can see that going wrong in some cases, did you got in one?

liesbeth12:02:11

Where it goes wrong in my case is that there is for example a query Chat in my schema. The eql [{:pep-link.chat [:pep-link.chat/id]}] becomes query { chat { id } }, but I need query { Chat { id } }

liesbeth12:02:38

I don’t think that it’s going wrong (in the sense that the code is doing something else than was your intention), but my schema conforms to another standard where the root queries and mutations are written with a capital

liesbeth12:02:53

I’ve checked out pathom but I don’t see directly where I should make the change. Should I be looking at node->graphql?

wilkerlucio12:02:35

@liesbeth thats a different problem I think, just to clarify, the GraphQL query would be something like: query { Chat(id: "...") { id name } }, is that correct?

liesbeth13:02:38

Yes, that would be it

wilkerlucio13:02:05

cool, for this case you should also take a look at ident-map thing, that's the recommened way to run those via pathom, so in pathom this would become: [{[:service.chat/id "..."] [:service.chat/id :service.chat/name]}]

liesbeth13:02:31

Thanks, got it hooked up!

wilkerlucio12:02:39

because it uses a local version that doesn't allow for replacing the ::pg/js-name fn

liesbeth13:02:20

@wilkerlucio Thanks! I’ll take a look at that 🙂

wilkerlucio13:02:01

@liesbeth please let me know how that goes, I would love to help and make the support more broad, since you actually have an use case lets get it fixed, I can take a revamp at the munging part tonight, if you can please list all the cases were the current transformation is failing, so far its about capitized entry points, but I guess you may find more

liesbeth13:02:33

@wilkerlucio This is the only problem that I’ve encountered so far, but I’ve just started this morning 😉