Add warnings when failing to identify a paginated field as a connection
See original GitHub issueI 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:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is now fixed in #344
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