You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Is there any chance codegen can be enhanced to allow for pagination out of the box? It'd be great to not have to write my own queries.ts with this ability.
Describe the solution you'd like
Take a model like this:
type User @model {
id: ID!
todos: [Todo] @connection(fields:["id"])
}
type Todo @model {
id: ID!
userID: ID!
user: User @connection(fields:["userID"]
}
As codegen operates currently, a queries file will be generated that looks something lik:
export const getUser =
GetUser($id: ID!) {
getUser($id: ID!) {
id
todos {
items {
id
}
}
}
}
To my understanding, pagination can only be achieved by then implementing a custom query like so:
I think this is a fairly easy opportunity to automate this process with codegen.
Describe alternatives you've considered
I use string interpolation to implement this functionality but it's really annoying when the schema changes to have to re-update the query.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is your feature request related to a problem? Please describe.
Is there any chance codegen can be enhanced to allow for pagination out of the box? It'd be great to not have to write my own queries.ts with this ability.
Describe the solution you'd like
Take a model like this:
As codegen operates currently, a queries file will be generated that looks something lik:
To my understanding, pagination can only be achieved by then implementing a custom query like so:
I think this is a fairly easy opportunity to automate this process with codegen.
Describe alternatives you've considered
I use string interpolation to implement this functionality but it's really annoying when the schema changes to have to re-update the query.
The text was updated successfully, but these errors were encountered: