question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add warnings when failing to identify a paginated field as a connection

See original GitHub issue

I am trying to delete an item from a paginated list, however when i try and add a name to my paginated query, i get the error @list can only be applied to types with an id field.

My schema is like this

...

type GroceriesEdge {
  cursor: Int!
  node: Grocery!
}

type Grocery {
  id: Int!
  name: String!
}

type PaginatedGroceries {
  edges: [GroceriesEdge!]!
  pageInfo: PageInfo!
}

And i am writing my query like this

const { loadNextPage, data } = paginatedQuery<Groceries>(graphql`
		query Groceries {
			paginatedGroceries(first: 10) @paginate(name: "SomeName") {
				edges {
					node {
						id
						name
					}
				}
			}
		}
	`);

But then when I generate the types i get the mentioned error.

I looked at the example in the repo, and I don’t see where my schema is different from yours.

Do you know what I am doing wrong?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
AlecAivaziscommented, Jun 28, 2022

This is now fixed in #344

0reactions
AlecAivaziscommented, Mar 21, 2022

The generator should have absolutely detected that the field existed but with the wrong type and given you a more useful warning message. This is the function that’s responsible for identifying a field as a connection. Assuming everything works, I’ll update the issues title to reflect that we need to improve the messaging here

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling operation errors - Apollo GraphQL Docs
Apollo Client can encounter a variety of errors when executing operations on your GraphQL server. Apollo Client helps you handle these errors according...
Read more >
Warnings - Ads API - Google Developers
In the Google Ads API, you can request that non-blocking errors in requests be returned in the response. This feature—called warnings—lets you handle...
Read more >
HTTP/1.1: Header Field Definitions
This header field MAY be used for logging purposes and as a means for identifying the source of invalid or unwanted requests. It...
Read more >
Common issues and resolutions for Power Apps
A list of common issues and resolutions within Power Apps.
Read more >
Links and accessibility - AccessibilityOz
The only way for a keyboard user to know which link, navigation item or field has focus, is if that item has a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found