Skip to content

Commit

Permalink
docs: Move API references (#9214)
Browse files Browse the repository at this point in the history
* Move SQL API reference

* Move REST API reference

* Move GraphQL API reference

* Move AI API reference

* Move CLI command reference

* Move JavaScript SDK reference
  • Loading branch information
igorlukanin authored Feb 12, 2025
1 parent 448a37a commit 60cff30
Show file tree
Hide file tree
Showing 56 changed files with 197 additions and 156 deletions.
2 changes: 1 addition & 1 deletion docs/pages/guides/dbt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ of the REST API.
[ref-dimension-types]: /reference/data-model/types-and-formats#dimension-types
[ref-data-graph]: /product/workspace/data-model#data-graph
[ref-playground]: /product/workspace/playground
[ref-rest-api-meta]: /reference/rest-api#v1meta
[ref-rest-api-meta]: /product/apis-integrations/rest-api/reference#v1meta

[link-dbt-docs]: https://docs.getdbt.com/docs/build/projects
[link-dbt-docs-structure]: https://docs.getdbt.com/guides/best-practices/how-we-structure/1-guide-overview#guide-structure-overview
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/guides/recipes/data-exploration/cast-numerics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,5 @@ you work with "safe integers".
[link-js-numbers]: https://www.w3schools.com/js/js_numbers.asp
[link-mdn-max-safe-integer]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER

[ref-cube-core]: /reference/frontend/cubejs-client-core
[ref-cube-core-cast-numerics]: /reference/frontend/cubejs-client-core#loadmethodoptions
[ref-cube-core]: http://localhost:3000/product/apis-integrations/javascript-sdk/reference/cubejs-client-core
[ref-cube-core-cast-numerics]: http://localhost:3000/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#loadmethodoptions
2 changes: 1 addition & 1 deletion docs/pages/guides/recipes/data-exploration/drilldowns.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,6 @@ cubes:
You can follow [this tutorial][blog-drilldown-api] to learn more about building
a UI for drilldowns.
[ref-cube-client-ref-resultset-drilldown]: /reference/frontend/cubejs-client-core#drill-down
[ref-cube-client-ref-resultset-drilldown]: /product/apis-integrations/javascript-sdk/reference/cubejs-client-core#drilldown
[blog-drilldown-api]: https://cube.dev/blog/introducing-a-drill-down-table-api-in-cubejs/
[ref-schema-ref-measures]: /reference/data-model/measures
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ dropdown on the dashboard:

In case we need to choose a dimension or render dropdowns for all dimensions, we
can fetch the list of dimensions for all cubes from the
[`/meta` endpoint](/reference/rest-api#v1meta):
[`/meta` endpoint](/product/apis-integrations/rest-api/reference#v1meta):

```bash
curl http://localhost:4000/cubejs-api/v1/meta
Expand Down
6 changes: 3 additions & 3 deletions docs/pages/product/apis-integrations/ai-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Use the `runQuery` request parameter to have the AI API run the query and report
}
```

The response will be the same as above, followed by a second JSON object representing the response (see the [REST API reference](/reference/rest-api#v1load) for its format).
The response will be the same as above, followed by a second JSON object representing the response (see the [REST API reference](/product/apis-integrations/rest-api/reference#v1load) for its format).

<InfoBox>
Note that the response now contains two JSON objects separated by a newline
Expand All @@ -117,7 +117,7 @@ The response will be the same as above, followed by a second JSON object represe

#### 2. `/load`

Alternatively, you may take the generated `cube_query` from the response and then call the [REST API `/load` endpoint](/reference/rest-api#v1load) with it in the `/load` request body. This is recommended for advanced use-cases where you need more control over formatting, pagination, etc. or if you are adding the AI API to an existing Cube REST API implementation.
Alternatively, you may take the generated `cube_query` from the response and then call the [REST API `/load` endpoint](/product/apis-integrations/rest-api/reference#v1load) with it in the `/load` request body. This is recommended for advanced use-cases where you need more control over formatting, pagination, etc. or if you are adding the AI API to an existing Cube REST API implementation.

### Error Handling

Expand Down Expand Up @@ -262,4 +262,4 @@ deployment. See below for required variables by provider (required unless noted)
- `OPENAI_API_KEY` - An OpenAI API key (we recommend creating a service account for the AI API)


[ref-ref-ai-api]: /reference/ai-api
[ref-ref-ai-api]: /product/apis-integrations/ai-api/reference
1 change: 1 addition & 0 deletions docs/pages/product/apis-integrations/ai-api/_meta.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
"privacy-security": "Privacy and Security",
"reference": "Reference"
};
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/pages/product/apis-integrations/graphql-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ to our query as follows:
[ref-cors]: /product/apis-integrations/rest-api#configuration-cors
[graphql]: https://graphql.org
[cube-ea]: https://cube.dev/use-cases/embedded-analytics
[ref-ref-graphql-api]: /reference/graphql-api
[ref-ref-graphql-api]: /product/apis-integrations/graphql-api/reference
[ref-websockets]: /product/apis-integrations/rest-api/real-time-data-fetch#web-sockets
[ref-subscriptions]: /product/apis-integrations/rest-api/real-time-data-fetch#client-subscriptions
[ref-compare-date-range]: /product/apis-integrations/queries#compare-date-range-query
[ref-metadata]: /reference/rest-api#v1meta
[ref-pivot-config]: /reference/frontend/cubejs-client-core#pivotconfig
[ref-metadata]: /product/apis-integrations/rest-api/reference#v1meta
[ref-pivot-config]: /product/apis-integrations/javascript-sdk/reference/cubejs-client-core#pivotconfig
[ref-segments]: /reference/data-model/segments
3 changes: 3 additions & 0 deletions docs/pages/product/apis-integrations/graphql-api/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
"reference": "Reference"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
---
redirect_from:
- /backend/graphql
---

# GraphQL API reference

[GraphQL API][ref-graphql-api] supports the following requests and parameters.
Expand Down
26 changes: 13 additions & 13 deletions docs/pages/product/apis-integrations/javascript-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ redirect_from:
Cube is visualization-agnostic, so you can build any user interface for your
application.

You can directly query Cube Backend using
JSON [Query Format](/product/apis-integrations/rest-api/query-format) via [HTTP API](/reference/rest-api)
You can directly query Cube using the
JSON [query format](/product/apis-integrations/rest-api/query-format) via the [REST API](/product/apis-integrations/rest-api/reference)
or
[WebSockets](/product/apis-integrations/rest-api/real-time-data-fetch#web-sockets)
and visualize analytical data with tools of your choice. However, it's much
Expand All @@ -25,25 +25,25 @@ Chart.js, D3.js, and more.
The client provides methods to solve common tasks:

**Abstract from the transport and query data.** You can
[fetch data](/reference/frontend/cubejs-client-core#load) from Cube Backend or
[fetch data](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#load) from Cube Backend or
subscribe to
[real-time updates](/product/apis-integrations/rest-api/real-time-data-fetch)
regardless of the protocol, be it HTTP or WebSockets.

**Transform data for visualization.** You can
[pivot](/reference/frontend/cubejs-client-core#pivot) the result set to display
as a [chart](/reference/frontend/cubejs-client-core#chart-pivot) or as a
[table](/reference/frontend/cubejs-client-core#table-pivot), split into
[series](/reference/frontend/cubejs-client-core#series) or
[table columns](/reference/frontend/cubejs-client-core#table-columns).
[pivot](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#pivot) the result set to display
as a [chart](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#chartpivot) or as a
[table](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#tablepivot), split into
[series](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#series) or
[table columns](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#tablecolumns).

**Simplify work with complex query types.** You can build
[Drill Down](/reference/frontend/cubejs-client-core#drill-down) queries and
[decompose](/reference/frontend/cubejs-client-core#decompose) the results of
[drill down](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#drilldown) queries and
[decompose](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#decompose) the results of
[compare date range queries][ref-compare-date-range]
or [Data Blending](/product/data-modeling/concepts/data-blending) queries.
or [data blending](/product/data-modeling/concepts/data-blending) queries.

[Learn more](/reference/frontend/cubejs-client-core) in the documentation for
[Learn more](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core) in the documentation for
the `@cubejs-client/core` package.

## Example Usage
Expand Down Expand Up @@ -129,4 +129,4 @@ console.log(resultSet.tablePivot())
[ref-rest-api]: /product/apis-integrations/rest-api
[link-max-safe-int]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
[ref-data-sources]: /product/configuration/data-sources
[ref-ref-loadmethodoptions]: /reference/frontend/cubejs-client-core#loadmethodoptions
[ref-ref-loadmethodoptions]: /product/apis-integrations/javascript-sdk/reference/cubejs-client-core#loadmethodoptions
3 changes: 2 additions & 1 deletion docs/pages/product/apis-integrations/javascript-sdk/_meta.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
"react": "React",
"vue": "Vue",
"angular": "Angular"
"angular": "Angular",
"reference": "Reference"
}
32 changes: 15 additions & 17 deletions docs/pages/product/apis-integrations/javascript-sdk/angular.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ redirect_from:
Cube is visualization-agnostic, so you can build any user interface for your
application.

You can directly query Cube Backend using
JSON [Query Format](/product/apis-integrations/rest-api/query-format) via [HTTP API](/reference/rest-api)
You can directly query Cube using the
JSON [query format](/product/apis-integrations/rest-api/query-format) via the [REST API](/product/apis-integrations/rest-api/reference)
or
[WebSockets](/product/apis-integrations/rest-api/real-time-data-fetch#web-sockets)
and visualize analytical data with tools of your choice. However, it’s much
Expand All @@ -25,37 +25,35 @@ including Chart.js, D3.js, and more.
The client provides methods to solve common tasks:

**Abstract from the transport and query data.** You can
[fetch data](/reference/frontend/cubejs-client-core#load) from Cube Backend or
[fetch data](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#load) from Cube Backend or
subscribe to
[real-time updates](/product/apis-integrations/rest-api/real-time-data-fetch)
regardless of the protocol, be it HTTP or WebSockets.

**Transform data for visualization.** You can
[pivot](/reference/frontend/cubejs-client-core#pivot) the result set to display
as a [chart](/reference/frontend/cubejs-client-core#chart-pivot) or as a
[table](/reference/frontend/cubejs-client-core#table-pivot), split into
[series](/reference/frontend/cubejs-client-core#series) or
[table columns](/reference/frontend/cubejs-client-core#table-columns).
[pivot](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#pivot) the result set to display
as a [chart](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#chartpivot) or as a
[table](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#tablepivot), split into
[series](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#series) or
[table columns](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#tablecolumns).

**Simplify work with complex query types.** You can build
[Drill Down](/reference/frontend/cubejs-client-core#drill-down) queries and
[decompose](/reference/frontend/cubejs-client-core#decompose) the results of
[drill down](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#drilldown) queries and
[decompose](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#decompose) the results of
[compare date range queries][ref-compare-date-range]
or [Data Blending](/product/data-modeling/concepts/data-blending) queries.
or [data blending](/product/data-modeling/concepts/data-blending) queries.

[Learn more](/reference/frontend/cubejs-client-core) in the documentation for
[Learn more](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core) in the documentation for
the `@cubejs-client/core` package.

## Cube Angular Package

The package provides convenient tools to work with Cube in Angular:

**Modules.** Inject
[CubeClientModule](/reference/frontend/cubejs-client-vue#query-builder) and
[CubeClient](/reference/frontend/cubejs-client-vue#query-renderer) into your
**Modules.** Inject [`CubeClientModule` and `CubeClient`](/product/apis-integrations/javascript-sdk/reference/cubejs-client-ngx#api) into your
components and services to get access to `@cubejs-client/core` API.

**Subjects.** Use [RxJS Subject](/reference/frontend/cubejs-client-ngx#api) and
**Subjects.** Use [RxJS Subject](/product/apis-integrations/javascript-sdk/reference/cubejs-client-ngx#api) and
query to watch changes.

## Example Usage
Expand All @@ -70,7 +68,7 @@ Here are the typical steps to query and visualize analytical data in Angular:
The client is also initialized with an [API token](/product/auth), but it
takes effect only in [production](/product/deployment/production-checklist).
- **Query data from Cube Backend and Transform data for visualization.** Use
[CubeClient](/reference/frontend/cubejs-client-ngx#api) to load data. The
[`CubeClient`](/product/apis-integrations/javascript-sdk/reference/cubejs-client-ngx#api) to load data. The
client accepts a query, which is a plain JavaScript object. See
[Query Format](/product/apis-integrations/rest-api/query-format) for details.
- **Visualize the data.** Use tools of your choice to draw charts and create
Expand Down
36 changes: 18 additions & 18 deletions docs/pages/product/apis-integrations/javascript-sdk/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ redirect_from:
Cube is visualization-agnostic, so you can build any user interface for your
application.

You can directly query Cube Backend using
JSON [Query Format](/product/apis-integrations/rest-api/query-format) via [HTTP API](/reference/rest-api)
You can directly query Cube using the
JSON [query format](/product/apis-integrations/rest-api/query-format) via the [REST API](/product/apis-integrations/rest-api/reference)
or
[WebSockets](/product/apis-integrations/rest-api/real-time-data-fetch#web-sockets)
and visualize analytical data with tools of your choice. However, it's much
Expand All @@ -25,43 +25,43 @@ Chart.js, D3.js, and more.
The client provides methods to solve common tasks:

**Abstract from the transport and query data.** You can
[fetch data](/reference/frontend/cubejs-client-core#load) from Cube Backend or
[fetch data](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#load) from Cube Backend or
subscribe to
[real-time updates](/product/apis-integrations/rest-api/real-time-data-fetch)
regardless of the protocol, be it HTTP or WebSockets.

**Transform data for visualization.** You can
[pivot](/reference/frontend/cubejs-client-core#pivot) the result set to display
as a [chart](/reference/frontend/cubejs-client-core#chart-pivot) or as a
[table](/reference/frontend/cubejs-client-core#table-pivot), split into
[series](/reference/frontend/cubejs-client-core#series) or
[table columns](/reference/frontend/cubejs-client-core#table-columns).
[pivot](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#pivot) the result set to display
as a [chart](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#chartpivot) or as a
[table](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#tablepivot), split into
[series](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#series) or
[table columns](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#tablecolumns).

**Simplify work with complex query types.** You can build
[Drill Down](/reference/frontend/cubejs-client-core#drill-down) queries and
[decompose](/reference/frontend/cubejs-client-core#decompose) the results of
[drill down](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#drilldown) queries and
[decompose](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#decompose) the results of
[compare date range queries][ref-compare-date-range]
or [Data Blending](/product/data-modeling/concepts/data-blending) queries.
or [data blending](/product/data-modeling/concepts/data-blending) queries.

[Learn more](/reference/frontend/cubejs-client-core) in the documentation for
[Learn more](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core) in the documentation for
the `@cubejs-client/core` package.

## Cube React Package

The package provides convenient tools to work with Cube in React:

**Hooks.** You can add the
[useCubeQuery hook](/reference/frontend/cubejs-client-react#use-cube-query) to
[useCubeQuery hook](/product/apis-integrations/javascript-sdk/reference/cubejs-client-react#usecubequery) to
functional React components to execute Cube queries.

**Components.** You can use
[QueryBuilder](/reference/frontend/cubejs-client-react#query-builder) and
[QueryRenderer](/reference/frontend/cubejs-client-react#query-renderer)
[`QueryBuilder`](/product/apis-integrations/javascript-sdk/reference/cubejs-client-react#querybuilder) and
[`QueryRenderer`](/product/apis-integrations/javascript-sdk/reference/cubejs-client-react#queryrenderer)
components to separate state management and API calls from your rendering code.
You can also use
[CubeProvider](/reference/frontend/cubejs-client-react#cube-provider) and
[CubeContext](/reference/frontend/cubejs-client-react#cube-context) components
for direct access to Cube Client anywhere in your application.
[`CubeProvider`](/product/apis-integrations/javascript-sdk/reference/cubejs-client-react#cubeprovider) and
[`CubeContext`](/product/apis-integrations/javascript-sdk/reference/cubejs-client-react#cubecontext) components
for direct access to Cube client anywhere in your application.

## Example Usage

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class AppModule { }
```

The `options` object is passed directly to
[@cubejs-client/core](/reference/frontend/cubejs-client-core).
[`@cubejs-client/core`](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core).

`CubeClientModule` provides `CubeClient`, which you can inject into your
components or services:
Expand Down Expand Up @@ -68,10 +68,10 @@ export class AppComponent {
## API

`CubeClient` provides the same API methods as
[@cubejs-client/core](/reference/frontend/cubejs-client-core#cubeapi). The
[`@cubejs-client/core`](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#cubeapi). The
difference is that instead of Promise it returns an
[Observable](http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html),
which passes [resultSet](/reference/frontend/cubejs-client-core#resultset) into
which passes [`resultSet`](/product/apis-integrations/javascript-sdk/reference/cubejs-client-core#resultset) into the
callback function.

Also you can use [RxJS Subject](https://rxjs-dev.firebaseapp.com/guide/subject)
Expand Down
Loading

0 comments on commit 60cff30

Please sign in to comment.