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

Model-based Query API only returns 1000 items #291

Closed
lawmicha opened this issue Jan 15, 2020 · 1 comment
Closed

Model-based Query API only returns 1000 items #291

lawmicha opened this issue Jan 15, 2020 · 1 comment
Labels
api Issues related to the API category

Comments

@lawmicha
Copy link
Contributor

lawmicha commented Jan 15, 2020

Currently the query API hardcodes the limit to 1000. when there are more than 1000 items, there's no way to retrieve the pass the 1000th item. We need to define what the query API should look like or before that focus on unblocking the developer by allowing options in the API call to pass in limit and nextToken and return some sort of PaginatedResult<[M]> that the developer can get the nextToken from.

    public static func query<M: Model>(from modelType: M.Type,
                                       where predicate: QueryPredicate? = nil) -> GraphQLRequest<[M]> {
        let document = GraphQLListQuery(from: modelType, predicate: predicate)
        // TODO: decodePath should just be document.name and return `GraphQLRequest<GraphQLListResponse<M>>`
        return GraphQLRequest<[M]>(document: document.stringValue,
                                   variables: document.variables,
                                   responseType: [M].self, // TODO: should be `GraphQLListResponse<M>`
                                   decodePath: document.name + ".items")
    }
@lawmicha lawmicha added the api Issues related to the API category label Jan 15, 2020
@lawmicha
Copy link
Contributor Author

lawmicha commented Mar 4, 2020

overall documenting a complex schema use case with different types of directives and how to make calls to AppSync should solve this for P0. closing and referencing to this issue over in that pivotal task

@lawmicha lawmicha closed this as completed Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues related to the API category
Projects
None yet
Development

No branches or pull requests

1 participant