Fork me on GitHub
#pathom
<
2019-06-17
>
Chris O’Donnell02:06:53

I'm struggling to get graphql queries with idents at their roots to resolve properly; would love some help/clarification if someone has a better understanding than I do. My query looks like [{[:gql.gift-list/id "id"] [:gql.gift-list/id :gql.gift-list/name]}]. It looks to me like the ident reader adds {:gql.gift-list/id "id"} to the current entity and tries to resolve :gql.gift-list/id and :gql.gift-list/name. However, gql.gift-list/name is not in my oir index, so it seems like the connect reader cannot find a way to resolve it. I've added "gift-list-by-pk", which is the graphql root query I'd like to use for gift list ident queries, to ::pcg/ident-map as {"gift-list-by-pk" {"id" :gql.gift-list/id}}. That doesn't seem to have affected the oir index. From what I've read of the source and the developer guide, it seems like there needs to be some change to the oir index to allow this query to be resolved. Anyone have suggestions/guidance/insight?

wilkerlucio03:06:10

@souenzzo recursiver queries are supported, are you still figuring this one out?

souenzzo10:06:22

no. i will try again later

wilkerlucio03:06:16

@codonnell you assumption seems correct, I just found a bit weird the names with dashes on graphql, if you are using the ns suggested by the docs (graphql2) there is no auto transform, so that seems an invalid name for GraphQL

Chris O’Donnell09:06:10

@wilkerlucio I have in my env that I pass to pcg/load-index:

::pcg/mung #(str/replace % \_ \-)
   ::pcg/demung #(str/replace % \- \_)

wilkerlucio13:06:19

@souenzzo considering the name you used :friends, is that a to-many? if it is I think it's not supported, recursive queries may need to be to-one relationships

👍 4
souenzzo13:06:27

Is it a design choice or an implementation detail?

wilkerlucio13:06:09

to be honest I don't remember, it may be possible, what I see is that this have the potential of exploding in number of items very quickly (multiplying every to-many step)

👍 4
Chris O’Donnell21:06:23

@wilkerlucio if there's anything I can do to help get ident join graphql queries like I mentioned above working, please let me know.

Chris O’Donnell21:06:17

I think it's the last piece I need to get fulcro and pathom interacting well with my graphql server.

wilkerlucio21:06:56

@codonnell would be interesting to debug that, did you tried checking the index after importing the graphql? I wonder if its a bug or just something in the setup, I have uses of that here and they are working, so I wonder if you hit some different space

Chris O’Donnell21:06:22

I did. Will describe them when I get onto a computer this evening.

Chris O’Donnell21:06:07

Tldr is the oir index only had input values for my root queries, not for any attributes.