Summary

The enableFeature() mutation enables a feature flag globally across the LogScale system. Use this mutation when you want to activate a feature for all users and organizations. To enable a feature for a single organization or user, use enableFeatureForOrg() or enableFeatureForUser() instead.

Syntax

graphql
enableFeature(
      feature: FeatureFlag!,
      skipVerification: Boolean
   ): Boolean!

The required feature argument accepts a FeatureFlag enum value that identifies the feature to enable. The optional skipVerification argument bypasses permission verification for the feature flag when set to true. The mutation returns a non-null Boolean! confirming whether the operation succeeded.

Example

Raw
graphql
mutation {
  enableFeature( 
       feature: FieldAliasing )
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  enableFeature( 
       feature: FieldAliasing )
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  enableFeature( 
       feature: FieldAliasing )
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "mutation { ^
  enableFeature(  ^
       feature: FieldAliasing ) ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  enableFeature( 
       feature: FieldAliasing )
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $query = "mutation {
  enableFeature( 
       feature: FieldAliasing )
}";
$query =~ s/\n/ /g;
my $json = sprintf('{"query" : "%s"}',$query);
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "mutation {
  enableFeature( 
       feature: FieldAliasing )
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "mutation {
  enableFeature( 
       feature: FieldAliasing )
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL',
  path: 'graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "enableFeature": true
  }
}

Input Parameters

Provide the feature flag to enable globally. Optionally, set skipVerification to bypass permission verification for the feature flag.

Table: Input Parameters & Datatypes

Parameter Type Required Default Description
This table contains all input parameters for this mutation. The feature parameter uses a special datatype; the following table lists its values.
feature FeatureFlag yes ย  The FeatureFlag enum value identifying the feature to enable globally. See the table below for available values.
skipVerification Boolean ย  false Enables the feature flag regardless of permission verification. When omitted or set to false, the system verifies that the caller has permission for the feature before enabling it.

The FeatureFlag enum identifies which feature to enable. Only one feature can be enabled per mutation call. The following table lists all available feature flags and their descriptions.