Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
This repository was archived by the owner on Feb 7, 2026. It is now read-only.

Types (e.g. TableMetadata) disallow valid API usage #332

@Tyler-Murphy

Description

@Tyler-Murphy

Environment details

  • OS: OSX 10.13
  • Node.js version: v11.7.0
  • npm version: 6.5.0
  • @google-cloud/bigquery version: 2.0.6

Steps to reproduce

Write this code:

dataset.createTable(
      'name'
      {
        view: {
          query: 'any SQL string',
          useLegacySql: false,
        },
      } as TableMetadata,
    )

The Typescript compiler will complain and say that friendlyName is required, and view must be a string. The types in the API documentation say that friendlyName is optional, and view is an object with some properties.

I discovered this when updating from v1.3 of the library to v2. I'd expect my existing, working library calls to pass type checking, since everything still works if I disable type checking and run the code.

Metadata

Metadata

Labels

api: bigqueryIssues related to the googleapis/nodejs-bigquery API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions