Fork me on GitHub
#pathom
<
2022-02-22
>
sheluchin10:02:04

How do I provide a GraphQL argument like this one?

issues(states: OPEN) {
  totalCount
}
[IssueState!].OPEN

An issue that is still open

Björn Ebbinghaus12:02:17

It should be:

{(:issues {:states "OPEN"})
 [:totalCount]}
But yes. The pathom3 docs doesn't show GraphQL parameters.

Björn Ebbinghaus12:02:43

Hm… Or is "OPEN" some sort of Enum Value… In this case… I don't know. Maybe as a keyword? :OPEN

sheluchin13:02:27

Tried both of those and it complains that the filter argument isn't an IssueState!.

sheluchin13:02:13

"clojure.lang.ExceptionInfo: Resolver github/organization-ident-entry-resolver exception at path []: GraphQL Error: Argument 'states' on Field 'issues' has an invalid value (\"OPEN\"). Expected type '[IssueState!]'. at path [\"query\" \"organization\" \"repositories\" \"edges\" \"node\" \"issues\" \"states\"] #:com.wsscode.pathom3.path{:path []}"
It looks like it encodes both "OPEN" and :OPEN as "OPEN" in the request it sends anyhow.

Björn Ebbinghaus13:02:58

"IssueState.OPEN"? :IssueState/OPEN?

sheluchin13:02:26

No luck on any of those.

sheluchin13:02:54

The IssueConnection can take a few different arguments. Among them:

states: [IssueState!]

A list of states to filter the issues by.

labels: [String!]

A list of label names to filter the pull requests by.
So there's a difference in arg type and it looks like our guesses for the notation are not correct.

sheluchin13:02:39

Pathom Viz didn't really offer any hints on this point either, and IssueState wasn't discoverable in the Explorer.

Björn Ebbinghaus14:02:57

Hm... The https://github.com/wilkerlucio/pathom3-graphql/blob/main/src/main/com/wsscode/pathom3/graphql.cljc#L28doesn't even query for enum values. Maybe there is simply no enum support in Pathom yet? @U066U8JQJ should know. 🙂

sheluchin14:02:19

I think that's likely it. This stuff is fairly new so I'm just flagging any issues I run into 🙂 don't mind me!

Björn Ebbinghaus14:02:30

But even if it doesn't query for the enum values... Pathom should know the IssueState type..

wilkerlucio14:02:15

in the enum case you should use a symbol

wilkerlucio14:02:28

as (:issues {:state OPEN}

🙏 1
sheluchin14:02:24

hahaha yet again it's always simpler than my first ten guesses

sheluchin14:02:43

TY, that does indeed work.

🙏 1