Skip to content

Document callback.nextQuery in query() #2174

Description

@jcondit

Can you document the callback.nextQuery parameter for the BigQuery query() function?

https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/packages/bigquery/src/index.js#L714

Without documenting this parameter, the generated docs are misleading. See https://issuetracker.google.com/36408121.

Activity

  1. stephenplusplus commented on Mar 31, 2017

    @stephenplusplus
    Contributor

    By default, nextQuery is not included in the response, which is why we don't include it in the documentation, instead using the example to demonstrate how it is meant to be used. That example for BigQuery is:

    To control how many API requests are made and page through the results manually, set autoPaginate to false.

    var callback = function(err, rows, nextQuery, apiResponse) {
      if (nextQuery) {
        bigquery.query(nextQuery, callback);
      }
    };
    
    bigquery.query({
      query: query,
      autoPaginate: false
    }, callback);

    The key part here is autoPaginate: false-- that's the argument which is true by default, and when disabled, will change the signature of the callback.

    Since it is not the default set of arguments to the function, I think we'd end up confusing more users by stating that their callback will receive the nextQuery argument.

    However, I do think we messed up-- we shouldn't show that the callback receives apiResponse, because that doesn't come by default either.

    @callmehiphop does all that sound correct?

  2. smarigowda commented on Apr 3, 2017

    @smarigowda

    Thank you for the detail response. I am now able to get the apiResponse.

  3. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Apr 4, 2017
  4. added a commit that references this issue on Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: bigqueryIssues related to the BigQuery API.priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions