Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination on nested connection #203

Open
alexhillel opened this issue Dec 18, 2018 · 2 comments
Open

Pagination on nested connection #203

alexhillel opened this issue Dec 18, 2018 · 2 comments

Comments

@alexhillel
Copy link

Is it possible to use the parameters passed into a query to use in a nested connection object representing an entries field?

In the following example, projectIndexEntries is an entries field which can contain many entries, and I'd like to receive a pagination object to determine whether to show a load more button.

query projectIndexEntry($limit: Int!, $offset: Int!) {
  projectIndexEntryConnection: entriesConnection(section: [projectIndex], limit: 1) {
    edges {
      node {
        ... on ProjectIndex {
          id
          title
          uri
          projectIndexEntriesConnection(limit: $limit, offset: $offset) {
            edges {
              node {
                ... on Project {
                  id
                  title
                  uri
                }
              }
            }
            pageInfo {
              hasNextPage
            }
          }
        }
      }
    }
  }
}

However, when I try this it errors saying 'GraphQL error: Unknown argument "limit" on field "projectIndexEntriesConnection" of type "ProjectIndex"'.

Is this something to do with the inline fragment ... on ProjectIndex? Is it possible to do this somehow?

@markhuot
Copy link
Owner

I need to add entry query arguments to the entries Connection fields. This is related to but not solved by #202. I'll keep this open and let you know when this is fixed.

@alexhillel
Copy link
Author

Great, thanks Mark. I appreciate your work on making this plugin even better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants