RQL Options

When creating a query execution objects, an options object can be passed. This document shows some of the options that can be passed.

const rql = new RapidQL({
	// This is the options object
});

Logging

const rql = new RapidQL({
	logLevel:'info'
});

This option will log all function node executions (API calls, DB queries etc...). Turned off by default.

HTTP Optional Default Parameters

When initializing your RapidQL instance, you can provide default parameters for HTTP requests by supplying an Http object as an option. This Http can set default parameters for headers, bearer, and basic. These parameters will then be sent with every HTTP request.

📘

X-RapidAPI-Header

A great example of how to use the default HTTP parameters is to add your X-RapidAPI-Key to every request! Since you can have multiple APIs from rapidapi.com that all use the same authentication key, you now don't have to send the header with each request.

const RapidQL = require('RapidQL');
const rql = new RapidQL({
    Http: {
        headers : {
            'X-RapidAPI-Key' : '*****************',
            'default' : 'this header will always be sent, unless defined otherwise at time of call'
        },
        basic : {
            username : 'my_username',
            password : 'my_password'
        }
    }
});

rql.log(`{
    Http.post(
        url:"http://httpbin.org/ip"
    ){
        
    }
}`)