BigQuery: GraphQL Queries
Introduction
GraphQL queries are used to fetch data from the server.
Hasura GraphQL Engine auto-generates queries as part of the GraphQL schema from your BigQuery schema model. It generates a range of possible queries and operators that also work with relationships defined in your SQL schema.
All tables of the database tracked by the GraphQL Engine can be queried over the GraphQL endpoint. If you have a tracked
table in your database, its query field is added as a nested field under the query_root
root level type.
Auto-generated query field schema
For example, the auto-generated schema for the query field for a table author
looks like the following:
author (
distinct_on: [author_select_column]
where: author_bool_exp
limit: Int
offset: Int
order_by: [author_order_by!]
): [author]
# single object select
author_by_pk (
# all primary key columns args
id: Int!
): author
See the Query API reference for the full specifications.
The query field will be of the format <dataset_name>_<table_name>
.
Exploring queries
You can explore the entire schema and the available queries using the GraphiQL
interface in the Hasura Console.
Let's take a look at the different queries you can run using the Hasura GraphQL Engine. We'll use examples based on a typical author/article schema for reference.