Fork me on GitHub
#pathom
<
2020-06-21
>
fricze17:06:39

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

fricze17:06:48

thanks for any help

souenzzo18:06:51

@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]}]}]}])

fricze20:06:46

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?