This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-30
Channels
- # announcements (3)
- # aws (5)
- # beginners (71)
- # boot (7)
- # calva (74)
- # cider (6)
- # clj-kondo (2)
- # cljs-dev (5)
- # clojars (6)
- # clojure (84)
- # clojure-dev (7)
- # clojure-europe (1)
- # clojure-italy (23)
- # clojure-nl (43)
- # clojure-sanfrancisco (1)
- # clojure-spec (4)
- # clojure-uk (173)
- # clojurebridge (1)
- # clojurescript (14)
- # cursive (44)
- # datomic (9)
- # duct (2)
- # emacs (2)
- # fulcro (4)
- # graalvm (4)
- # graphql (27)
- # hoplon (6)
- # keechma (50)
- # off-topic (3)
- # other-languages (8)
- # pathom (2)
- # pedestal (14)
- # planck (5)
- # re-frame (3)
- # reitit (6)
- # ring (2)
- # robots (2)
- # spacemacs (9)
- # tools-deps (15)
- # vim (44)
@currentoor you can use an introspection query for that https://graphql.org/learn/introspection/
ah thanks @pcj
is anyone using cursor based pagination with lacinia? https://graphql.org/learn/pagination/
It’s not public. But here is basically what it looks like:
:PagedFoo
{:fields
{:foo_list {:type (list :Foo)}
:next_page_cursor {:type String}}}
I see in that link you posted, they chose to put PageInfo
in friends
, whereas we chose to wrap our data object in the paging.
I haven’t thought deeply about their approach, but one possible problem I see is that now the Friend type has to know about paging. Maybe that makes sense, but for us at least we have paths to get single Foo objects, so paging wouldn’t make sense in that context
I think also that ours could be written:
:PagedFoo
{:fields
{:foo_list {:type (list :Foo)}
:page_info {:type PageInfo}}}
But the details of paging over Foo’s might be different than paging over Bar’s, so it’s possible not much might be shared besides the data type
that makes sense. i need to contemplate how this maps to the "connections" concept. e.g.:
{
hero {
name
friendsConnection(first:2 after:"Y3Vyc29yMQ==") {
totalCount
edges {
node {
name
}
cursor
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
just to complete my example, here’s the query resolver with the cursor arg:
:list_of_foos
{:type :PagedFoo
:args {:cursor {:type String}
:limit {:type Int :default-value 25}}
:resolve ....}