pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
fricze 2020-06-21T17:38:39.234800Z

Hi! I’m trying to generate GraphQL from EQL using Pathom, and it works, mostly, flawless. Unfortunately I cannot see how to set operation name. Examples can be seen here https://graphql.org/learn/queries/

query HeroNameAndFriends {
  hero {
    name
    friends {
      name
    }
  }
}
query HeroNameAndFriends($episode: Episode) {
  hero(episode: $episode) {
    name
    friends {
      name
    }
  }
}
I can only query fields. No way to query operation by name. Am I missing something, is this functionality hidden? If it’s not, I’m more than happy to create PR to Pathom GraphQL generation

fricze 2020-06-21T17:38:48.235300Z

thanks for any help

souenzzo 2020-06-21T18:45:51.237300Z

@andrzej.fricze once EQL is defined in terms of arrays/map/lists and you can assoc / update these datastructures, EQL has many less features then GraphQL this query in Clojure will be something like

(defn HeroNameAndFriends
  [episode]
  `[{:HeroNameAndFriends [{(:hero {:episode ~episode})
                           [:name {:friends [:name]}]}]}])

fricze 2020-06-21T20:29:46.238900Z

unfortunately this doesn’t set HeroNameAndFriends as operation name. it’s just one of query fields. maybe my assumption Was wrong from the beginning, and Pathom doesn’t intend to recreate full GraphQL query API, only a valid subset?