Skip to content

Latest commit

 

History

History
79 lines (61 loc) · 1.44 KB

README.md

File metadata and controls

79 lines (61 loc) · 1.44 KB

OneBlink Graphql Node SDK

A graphql interface for @oneblink/sdk v1.0.0

Installation

npm i oneblink-graphql-sdk

Usage

The package exports a number of classes that can be used to access OneBlink Productivity Suite instances

Instance Functions

To query traditional SDK instance functions you need an access key and secret key

import { Forms } from "oneblink-graphql-sdk";

const formsService = new Forms({ accessKey: "abc", secretKey: "xyz" });

formsService.query(`{
  getForm(formId: 1){
    id,
    name,
    description,
    organisationId,
    isMultiPage,
    formsAppIds,
    submissionEvents,
    updatedAt
  }
}`);

Static functions

The static functions do not require an access key and secret key

import { Forms } from "oneblink-graphql-sdk";

Forms.query(`{
  validateFormEvent(formElements: [], data:{type: "CALLBACK", configuration: {
      url: "https://www.oneblink.io",
      secret: "secret"
    }
  }){
    ... on CallbackSubmissionEvent {
      type,
      label
      configuration {
        url
      }
    }
  }
}`);

OneBlink Node SDK

The underlying instance and static methods are still available too, e.g.

import { Forms } from 'oneblink-graphql-sdk";

Forms.validateFormEvent(
  [],
  {
    type: "CALLBACK",
    configuration: {
      url: "https://www.oneblink.io",
      secret: "secret"
    }
  }
})