PageSourceSearch

https://fusedata.dev/_next/static/chunks/pages/docs/server/lists-bf2de28bb57fb5d6.js

js fusedata.dev collected 2026-10-05 22:52:50 UTC 35,784 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[992],{6014:function(s,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/docs/server/lists",function(){return n(5602)}])},5602:function(s,e,n){"use strict";n.r(e),n.d(e,{__toc:function(){return a}});var r=n(5250),o=n(8720),l=n(5074),i=n(6965);n(664);var t=n(2318);let a=[{depth:2,value:"List",id:"list"},{depth:2,value:"Connection",id:"connection"}];function c(s){let e=Object.assign({h1:"h1",p:"p",code:"code",h2:"h2",pre:"pre",span:"span"},(0,t.a)(),s.components);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e.h1,{children:"Lists"}),"\n",(0,r.jsxs)(e.p,{children:["In ",(0,r.jsx)(e.code,{children:"fuse"})," we offer two types of lists when building fields ",(0,r.jsx)(e.code,{children:"t.list"})," and ",(0,r.jsx)(e.code,{children:"t.connection"}),".\nThe difference between the two is their specialization, ",(0,r.jsx)(e.code,{children:"t.connection"})," is specialised towards\ncursor-based pagination and ",(0,r.jsx)(e.code,{children:"t.list"})," is more general purpose."]}),"\n",(0,r.jsx)(e.h2,{id:"list",children:"List"}),"\n",(0,r.jsxs)(e.p,{children:["When using the ",(0,r.jsx)(e.code,{children:"list"})," type as followed:"]}),"\n",(0,r.jsx)(e.pre,{"data-language":"typescript","data-theme":"default",children:(0,r.jsxs)(e.code,{"data-language":"typescript","data-theme":"default",children:[(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" { addQueryFields } "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'fuse'"})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:" "}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"addQueryFields"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"((t) "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ({"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  users"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"t"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".list"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"({"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"    type"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" UserNode"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"    nullable"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"false"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"    args"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"      offset"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"t"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"."}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"arg"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".int"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"}
1,children:"()"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"      limit"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"t"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"."}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"arg"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".int"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"()"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"    }"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"resolve"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"async"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" (_"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" args"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" context) "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"      "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"const"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"result"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"await"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"getUsers"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"({"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        skip"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"args"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:".offset"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        take"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"args"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:".limit"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"      })"})}),"\n",(0,r.jsx)(e.span,{className:"line",children:" "}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"      "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"return"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"// It's also possible to return a list of ids here in case your"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"// list endpoint doesn't have all the needed details of the user"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"// then the node will resolve the rest of the entity."})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        nodes"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"result"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:".users"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        totalCount"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"result"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:".totalCount"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"      }"})}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"    }"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  })"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"}))"})})]})}),"\n",(0,r.jsx)(e.p,{children:"For the above, we get a GraphQL type like this:"}),"\n",(0,r.jsx)(e.pre,{"data-language":"graphql","data-theme":"default",children:(0,r.jsxs)(e.code,{"data-language":"graphql","data-theme":"default",children:[(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"type"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"UserList"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  nodes: ["}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"User"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"]"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  totalCount: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"Int"})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,r.jsx)(e.span,{className:"line",children:" "}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"type"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"Query"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  users(limit: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"Int"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:", offset: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"Int"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"): "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"UserList"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!"})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,r.jsxs)(e.p,{children:["The ",(0,r.jsx)(e.code,{children:"nodes"})," will output the type you specify the ",(0,r.jsx)(e.code,{children:"list"})," to return, the ",(0,r.jsx)(e.code,{children:"totalCount"})," has been made ",(0,r.jsx)(e.code,{children:"optional"}),"\non purpose in case your datasource does not return this information."]}),"\n",(0,r.jsx)(e.h2,{id:"connection",children:"Connection"}),"\n",(0,r.jsxs)(e.p,{children:["When using the ",(0,r.jsx)(e.code,{children:"connection"})," type as followed:"]}),"\n",(0,r.jsx)(e.pre,{"data-language":"typescript","data-theme":"default",children:(0,r.jsxs)(e.code,{"data-language":"typescript","data-theme":"default",children:[(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" { addQueryFields } "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'fuse'"})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:" "}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"addQueryFields"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"((t) "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ({"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  users"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"t"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".connection"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"({"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"    type"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"}
1,children:" UserNode"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"    nullable"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"false"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"resolve"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"async"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" (_"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" args"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" context) "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"      "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"const"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"result"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"await"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"getUsers"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"({"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        skip"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"args"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:".offset"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        take"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"args"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:".limit"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"      })"})}),"\n",(0,r.jsx)(e.span,{className:"line",children:" "}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"      "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"return"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        edges"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"result"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"."}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"users"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".map"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(user "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" ({"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"          node"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" user"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"          cursor"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"user"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:".id"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        }))"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"        pageInfo"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"getPageInfo"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"(result)"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"      }"})}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"    }"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  })"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"}))"})})]})}),"\n",(0,r.jsx)(e.p,{children:"For the above, we get a GraphQL type like this:"}),"\n",(0,r.jsx)(e.pre,{"data-language":"graphql","data-theme":"default",children:(0,r.jsxs)(e.code,{"data-language":"graphql","data-theme":"default",children:[(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"type"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"UserEdge"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  cursor: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"String"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  node: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"User"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!"})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,r.jsx)(e.span,{className:"line",children:" "}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"type"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"PageInfo"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  hasNextPage: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"Boolean"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  hasPreviousPage: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"Boolean"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  startCursor: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"String"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  endCursor: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"String"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!"})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,r.jsx)(e.span,{className:"line",children:" "}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"type"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"UserConnection"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  edges: ["}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"UserEdge"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"]"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!"})]}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  pageInfo: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"PageInfo"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!"})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"}"})}),"\n",(0,r.jsx)(e.span,{className:"line",children:" "}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"type"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"Query"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-comment)"},children:"  ## Note that the arguments for cursor-based pagination are included automatically"})}),"\n",(0,r.jsxs)(e.span,{className:"line",children:[(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"  users(after: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"String"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:", before: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"String"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:", first: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"Int"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:", last: "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"Int"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"): "}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"QueryLaunchesConnection"}),(0,r.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"!"})]}),"\n",(0,r.jsx)(e.span,{className:"line",children:(0,r.jsx)(e.span,{style:{color:"var(--shiki-color-text)"},children:"}"})})]})}),"\n",(0,r.jsxs)(e.p,{children:["As you can see, this type is a lot more in-depth and gears towards cursor-based pagination. The ",(0,r.jsx)(e.code,{children:"edges"})," can\nbe customised to for instance carry relational attributes, this could for instance be the ",(0,r.jsx)(e.code,{children:"role"})," of the user in\nrelation to the parent where this connection is being queried from."]})]})}let d={MDXContent:function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:e}=Object.assign({},(0,t.a)(),s.components);return e?(0,r.jsx)(e,{...s,children:(0,r.jsx)(c,{...s})}):c(s)},pageOpts:{filePath:"src/pages/docs/server/lists.mdx",route:"/docs/server/lists",pageMap:[{kind:"Meta",data:{index:{type:"page",title:"Fuse",dis
1play:"hidden",theme:{layout:"full"}},docs:{type:"page",display:"hidden",title:"Documentation"}}},{kind:"Folder",name:"docs",route:"/docs",children:[{kind:"Meta",data:{index:"Getting Started",client:"Querying your API (client)",server:"Building your API (server)",deployment:"Deploying your API (server)","fuse-method":"The Fuse Method","setting-fuse-up-manually":"Setting up Fuse manually",troubleshooting:"Troubleshooting"}},{kind:"Folder",name:"client",route:"/docs/client",children:[{kind:"Meta",data:{index:"Overview","best-practices":"Best practices",types:"Types",javascript:"JavaScript frameworks",other:"Other languages"}},{kind:"MdxPage",name:"best-practices",route:"/docs/client/best-practices"},{kind:"MdxPage",name:"index",route:"/docs/client"},{kind:"Folder",name:"javascript",route:"/docs/client/javascript",children:[{kind:"Meta",data:{react:"React & React Native",nextjs:"Next.js",vue:"Vue",angular:"Angular"}},{kind:"MdxPage",name:"angular",route:"/docs/client/javascript/angular"},{kind:"MdxPage",name:"nextjs",route:"/docs/client/javascript/nextjs"},{kind:"MdxPage",name:"react",route:"/docs/client/javascript/react"},{kind:"MdxPage",name:"vue",route:"/docs/client/javascript/vue"}]},{kind:"Folder",name:"other",route:"/docs/client/other",children:[{kind:"Meta",data:{ios:"iOS",android:"Android (Java/Kotlin)",http:"HTTP"}},{kind:"MdxPage",name:"android",route:"/docs/client/other/android"},{kind:"MdxPage",name:"http",route:"/docs/client/other/http"},{kind:"MdxPage",name:"ios",route:"/docs/client/other/ios"}]},{kind:"MdxPage",name:"types",route:"/docs/client/types"}]},{kind:"Folder",name:"deployment",route:"/docs/deployment",children:[{kind:"Meta",data:{index:"Overview",node:"Node.js",lambda:"Lambda","cloudflare-workers":"Cloudflare Workers",nextjs:"Next.js API Routes",bun:"Bun"}},{kind:"MdxPage",name:"bun",route:"/docs/deployment/bun"},{kind:"MdxPage",name:"cloudflare-workers",route:"/docs/deployment/cloudflare-workers"},{kind:"MdxPage",name:"index",route:"/docs/deployment"},{kind:"MdxPage",name:"lambda",route:"/docs/deployment/lambda"},{kind:"MdxPage",name:"nextjs",route:"/docs/deployment/nextjs"},{kind:"MdxPage",name:"node",route:"/docs/deployment/node"}]},{kind:"Folder",name:"fuse-method",route:"/docs/fuse-method",children:[{kind:"Meta",data:{index:"Overview","vs-backend-for-frontends":"vs. Backend-for-Frontends","vs-graphql-federation":"vs. GraphQL Federation"}},{kind:"MdxPage",name:"index",route:"/docs/fuse-method"},{kind:"MdxPage",name:"vs-backend-for-frontends",route:"/docs/fuse-method/vs-backend-for-frontends"},{kind:"MdxPage",name:"vs-graphql-federation",route:"/docs/fuse-method/vs-graphql-federation"}]},{kind:"MdxPage",name:"index",route:"/docs"},{kind:"Folder",name:"server",route:"/docs/server",children:[{kind:"Meta",data:{"queries-and-mutations":"Queries and Mutations",nodes:"Nodes",lists:"Handling lists","objects-enums-unions-interfaces":"Objects, Enums, Unions, and Interfaces",context:"Context",integrations:"Integrating data sources","error-handling":"Error handling",authorization:"Authorization",mocking:"Mocking data"}},{kind:"MdxPage",name:"authorization",route:"/docs/server/authorization"},{kind:"MdxPage",name:"context",route:"/docs/server/context"},{kind:"MdxPage",name:"error-handling",route:"/docs/server/error-handling"},{kind:"Folder",name:"integrations",route:"/docs/server/integrations",children:[{kind:"Meta",data:{index:"Overview",rest:"REST",prisma:"Prisma",drizzle:"Drizzle",kysely:"Kysely",grpc:"gRPC"}},{kind:"MdxPage",name:"drizzle",route:"/docs/server/integrations/drizzle"},{kind:"MdxPage",name:"grpc",route:"/docs/server/integrations/grpc"},{kind:"MdxPage",name:"index",route:"/docs/server/integrations"},{kind:"MdxPage",name:"kysely",route:"/docs/server/integrations/kysely"},{kind:"MdxPage",name:"prisma",route:"/docs/server/integrations/prisma"},{kind:"MdxPage",name:"rest",route:"/docs/server/integrations/rest"}]},{kind:"MdxPage",name:"lists",route:"/docs/server/lists"},{kind:"MdxPage",name:"mocking",route:"/docs/server/mocking"},{kind:"MdxPage",name:"nodes",route:"/docs/server/nodes"},{kind:"MdxPage",name:"objects-enums-unions-interfaces",route:"/docs/server/objects-enums-unions-interfaces"},{kind:"MdxPage",name:"queries-and-mutations",route:"/docs/server/queries-and-mutations"}]},{kind:"Folder",name:"setting-fuse-up-manually",route:"/docs/setting-fuse-up-manually",children:[{kind:"Meta",data:{index:"Overview",nextjs:"Next.js Integration"}},{kind:"MdxPage",name:"index",route:"/docs/setting-fuse-up-manually"},{kind:"MdxPage",name:"nextjs",route:"/docs/setting-fuse-up-manually/nextjs"}]},{kind:"MdxPage",name:"troubleshooting",route:"/docs/troubleshooting"}]}],flexsearch:{codeblocks:!0},title:"Lists",headings:a},pageNextRoute:"/docs/server/lists",nextraLayout:l.ZP,themeConfig:i.Z};e.default=(0,o.j)(d)},6965:function(s,e,n){"use strict";var r=n(5250),o=n(5074),l=n(4427),i=n(2218),t=n(7216);let a={logo:(0,r.jsx)(i.L1,{}),primaryHue:88,primarySaturation:{light:50,dark:99},docsRepositoryBase:"https://github.com/StellateHQ/fuse/tree/main/website",useNextSeoProps:()=>({}),head:function(){let{asPath:s}=(0,l.useRouter)(),{frontMatter:e,title:n}=(0,o.ZR)();return(0,t.a)({title:n,url:"https://fusedata.dev"+s,description:e.description})},footer:{text:(0,r.jsxs)("span",{children:["\xa9 ",new Date().getFullYear()," ",(0,r.jsx)("a",{href:"https://stellate.co",target:"_blank",children:"Stellate, Inc"})]})},gitTimestamp:null};e.Z=a}},function(s){s.O(0,[169,417,139,774,888,179],function(){return s(s.s=6014)}),_N_E=s.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.