Go Back
Graph QL Reader
Publisher
:
Run In Lingk
Description
This recipe demonstrates how to utilize Lingk's GraphQL reader to read data from GraphQL endpoints.
Browse the knowledge base
Twitter
E-Mail
# _____ _ _____ __ # | __ \ (_) |_ _| / _| # | |__) |___ ___ _ _ __ ___ | | _ __ | |_ ___ # | _ // _ \/ __| | '_ \ / _ \ | | | '_ \| _/ _ \ # | | \ \ __/ (__| | |_) | __/ _| |_| | | | || (_) | # |_| \_\___|\___|_| .__/ \___| |_____|_| |_|_| \___/ # | | # |_| # Project Name - Graph QL Reader # Recipe URL - https://app.lingk.io/a/10932/tf/18572 # Description - This recipe demonstrates how to utilize Lingk's GraphQL reader to read data from GraphQL endpoints. # Systems - GraphQL # Connectors - HTTP # Data Flows - Single Direction # Connection Type - API # Add Recipe notes / Change log information here! # _____ _ # / ____| | | # | | ___ _ __ _ __ ___ ___| |_ ___ _ __ ___ # | | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __| # | |___| (_) | | | | | | | __/ (__| || (_) | | \__ \ # \_____\___/|_| |_|_| |_|\___|\___|\__\___/|_| |___/ # # CONNECTORS specify what data will be pulled into the in-memory database during processing connectors: # Configure Canvas connector in your Environment before running this recipe # Canvas Setup - https://help.lingk.io/en/articles/263-canvas-setup-guide # Setup an env variable where the token and url path values can be stored # You can specify in the 'fields' paramters the schema name fields and object type - name: canvasGraphQlQuery type: graphqlReader properties: url: {{env.urlPath}} headerJson: > { "Authorization":"Bearer {{env.token}}", "Content-Type": "application/json"} httpMethod: POST body: '{"query":"query allGrades {\n\tterm(sisId: \"2224\") {\n\t\t\n\t\tcoursesConnection(first: 150, after: \"\") {\n\t\t\tedges {\n\t\t\t\tnode {\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tenrollmentsConnection(filter: { types: [StudentEnrollment] }) {\n\t\t\t\t\t\tedges {\n\t\t\t\t\t\t\tnode {\n\t\t\t\t\t\t\t\tuser {\n\t\t\t\t\t\t\t\t\tintegrationId\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tgrades {\n\t\t\t\t\t\t\t\t\tcurrentGrade\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\tpageInfo {\n\t\t\t\t\t\t\t\t\n\t\t\t\thasNextPage\n\t\t\t\t\t\t\t\t\n\t\t\t\tendCursor\n\t\t\t}\n\t\t}\n\t}\n}\n"}' debug: true schema: fields: - name: starSchema fields: - name: 'data' type: 'object' objectSchema: name: objectSchemaSchema fields: - name: 'term' type: 'object' objectSchema: name: objectSchemaSchema fields: - name: 'coursesConnection' type: 'object' objectSchema: name: objectSchemaSchema fields: - name: 'edges' type: 'array' items: name: 'arrayElement' type: 'object' objectSchema: name: objectSchemaSchema fields: - name: 'cursor' type: 'string' - name: 'node' type: 'object' objectSchema: name: objectSchemaSchema fields: - name: 'enrollmentsConnection' type: 'object' objectSchema: name: objectSchemaSchema fields: - name: 'edges' type: 'array' items: name: 'arrayElement' type: 'object' objectSchema: name: objectSchemaSchema fields: - name: 'node' type: 'object' objectSchema: name: objectSchemaSchema fields: - name: 'grades' type: 'object' objectSchema: name: objectSchemaSchema fields: - name: 'currentGrade' type: 'string' - name: 'user' type: 'object' objectSchema: name: objectSchemaSchema fields: - name: 'integrationId' type: 'string' - name: 'pageInfo' type: 'object' objectSchema: name: objectSchemaSchema fields: - name: 'hasNextPage' type: 'boolean' # _____ _ _ _ # / ____| | | | | | # | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_ ___ # \___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __/ __| # ____) | || (_| | || __/ | | | | | __/ | | | |_\__ \ # |_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|___/ # STATEMENTS specify how the data should be processed while in memory statements: # Reads the result from the GraphQL connector request - statement: (star) => select * from canvasGraphQlQuery # Prints the data retrieved in the previous statement - statement: print star # Add more statements to convert, join, aggregrate, transform, and integrate your data
Custom Output via Imports
Append File Task