This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-07
Channels
- # announcements (35)
- # beginners (80)
- # boot (1)
- # calva (4)
- # cider (33)
- # cljdoc (40)
- # clojars (3)
- # clojure (95)
- # clojure-berlin (2)
- # clojure-europe (4)
- # clojure-italy (28)
- # clojure-nl (2)
- # clojure-seattle (1)
- # clojure-serbia (1)
- # clojure-spec (74)
- # clojure-uk (71)
- # clojurescript (29)
- # core-async (1)
- # cursive (80)
- # data-science (4)
- # datomic (17)
- # duct (75)
- # emacs (4)
- # figwheel-main (5)
- # fulcro (3)
- # jackdaw (1)
- # java (1)
- # jobs-discuss (20)
- # off-topic (32)
- # parinfer (2)
- # pathom (23)
- # re-frame (26)
- # reagent (25)
- # rum (6)
- # shadow-cljs (122)
- # speculative (4)
- # sql (17)
- # testing (7)
- # yada (8)
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?
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 🙂
@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
just not sure how, but I'm open to design ideas 🙂
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.
@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
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
capitalized is the default in graphql, pathom converts it to kebab case to be more clojure friendly
but I can see that going wrong in some cases, did you got in one?
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 } }
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
I’ve checked out pathom but I don’t see directly where I should make the change. Should I be looking at node->graphql
?
@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?
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]}]
but I think I see the issue, this is the problematic line: https://github.com/wilkerlucio/pathom/blob/a23c3e708932223823fa9ac97d2b4c7fdbdd8f58/src/com/wsscode/pathom/connect/graphql.cljc#L369
because it uses a local version that doesn't allow for replacing the ::pg/js-name
fn
@wilkerlucio Thanks! I’ll take a look at that 🙂
@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
@wilkerlucio This is the only problem that I’ve encountered so far, but I’ve just started this morning 😉