Snowflake is a cloud-based data warehousing company that provides a platform for storing, managing, and analyzing large amounts of data. Improving the getting started experience for Snowflake makes the GraphQL journey easily configurable and drives value from StepZen and Snowflake as quickly as possible. By the end of this getting started experience with Snowflake, you will have a deployed GraphQL endpoint querying data from a Snowflake data cloud.

Creating a Snowflake Account

Create a Snowflake account at https://snowflake.com. Snowflake will generate dummy data for you to help us get started.

Find the information below so StepZen can access and introspect your Snowflake data source.

Account Identifier=HCMEHUY.ERB38196
Username=samhill
Password=xxxx
Database Name=SNOWFLAKE_SAMPLE_DATA
Database Schema=TPCDS_SF100TCL
Warehouse=TUT_WH

Here are some screenshots for reference of where to find this data.

Snowflake Account ID Snowflake Account ID

Snowflake Warehouse Snowflake Warehouse

StepZen Import

Go to the new getting started experience to import your Snowflake data source.

This will take you to step 2, where you can input the Snowflake configurations we discovered earlier.

Snowflake Input Variables

In Step 3, set up the StepZen CLI. Skip this section if you have already installed the CLI on your machine.

In Step 4, the getting started experience will guide you through three steps.

  1. Initialize a new endpoint, api/getting-started.
  2. Generate a Snowflake import command.

Example

stepzen import snowflake --db-user='samhill' --db-password='xxxx' --db-database='SNOWFLAKE_SAMPLE_DATA' --db-schema='TPCDS_SF100TCL' --snowflake-account-id='HCMEHUY.ERB38196' --snowflake-warehouse='TUT_WH'

When you successfully import the Snowflake data source, a GraphQL schema is generated on your machine and references the Snowflake database with the custom directive, @dbquery, https://stepzen.com/docs/connecting-backends.

  1. Deploy the new GraphQL schema by executing stepzen start in your terminal.

The CLI command stepzen start deploys a new StepZen GraphQL endpoint to the cloud. To ensure our newly generated endpoint can successfully query the Snowflake data source, we need to execute a GraphQL request to the StepZen endpoint properly.

Query the Snowflake data with GraphQL

The GraphQL schema is now generated, and by executing stepzen start inside of this schema folder, a new endpoint is deployed and ready to be queried.

If you initialized the new endpoint, api/getting-started, you can query your endpoint in the dashboard here, https://dashboard.stepzen.com/explorer?endpoint=api%2Fgetting-started.

StepZen autogenerates a sample query for newly generated endpoints. The provided sample query is a great start to seeing your Snowflake data being made available in GraphQL. If you are having issues querying the Snowflake data, see what error is returned in the StepZen dashboard and double-check your Snowflake configurations in your config.yaml. Sample Snowflake Query

What's next?

Data retrieval for frontend development is now more accessible by using the GraphQL schema powered by StepZen. StepZen is continuously providing more data sources for the getting started experience. Connect with our team on Discord if you desire a data source to be easily configured for GraphQL introspection and deployment.