Custom Connector Profile

Author: Matillion
Date Posted: Mar 5, 2025
Last Modified: Mar 7, 2025

GraphQL Custom Connector Example

Examples of custom Script Paging using the Rick and Morty GraphQL API.

This Data Productivity Cloud Custom Connector extracts and loads data from the Rick and Morty GraphQL API. The paging method requires customized paging, and the connector demonstrates how to do this for both POST and GET requests.

Once installed, you can use it in an Orchestration pipeline:

Image ofRick and Morty GraphQL extract
Rick and Morty GraphQL extract

Endpoints

Both these endpoints extract the same data, demonstrating the two different approaches that are possible with this GraphQL API.

  • Rick and Morty POST
  • Rick and Morty GET

Integrating semi-structured data using vertical decomposition

In the screenshot above, you can see the data is extracted into a table named stg_rm_data.

Using Snowflake as an example, the SQL query to perform vertical decomposition requires a LATERAL FLATTEN clause:

SELECT f.Value:"id" :: INT AS Id, f.Value:"name" :: VARCHAR AS Name, f.Value:"type" :: VARCHAR AS Type
FROM "stg_rm_data" p,
LATERAL FLATTEN(input => p."data":"characters":"results") f;

In Data Productivity Cloud this can be done using an Extract Nested Data component in a Transformation pipeline:

Image ofVertical Decomposition with a Lateral Flatten
Vertical Decomposition with a Lateral Flatten

Once the data has been converted to a relational format with rows and columns, it’s easy to work with further - for example to summarize, or to integrate with other data sets.


Downloads

Licensed under: Matillion Free Subscription License

Installation Instructions

How to Install a Data Productivity Cloud Custom Connector