Summary

The deleteFeatureFlag() mutation is deprecated. Use resetFeature() instead. LogScale will remove this mutation at the earliest in version 1.270.

Despite its name, this mutation does not delete the feature flag itself. It clears all overrides for the specified feature flag at the cluster, organization, and user levels, reverting the flag to its compiled default value. The ambiguous name was the primary reason for deprecation.

Syntax

graphql
deleteFeatureFlag(
      feature: String!
   ): Boolean!

The mutation takes one required argument, feature, which identifies the feature flag to reset. It returns a non-null Boolean indicating whether the operation succeeded.

Example

Raw
graphql
mutation {
  deleteFeatureFlag(
     feature: "SomeFeature", 
  )
}
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 {
  deleteFeatureFlag(
     feature: \"SomeFeature\", 
  )
}"
}
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 {
  deleteFeatureFlag(
     feature: \"SomeFeature\", 
  )
}"
}
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 { ^
  deleteFeatureFlag( ^
     feature: \"SomeFeature\",  ^
  ) ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  deleteFeatureFlag(
     feature: \"SomeFeature\", 
  )
}"
}'
    "$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 {
  deleteFeatureFlag(
     feature: \"SomeFeature\", 
  )
}";
$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 {
  deleteFeatureFlag(
     feature: \"SomeFeature\", 
  )
}"
}'''

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 {
  deleteFeatureFlag(
     feature: \"SomeFeature\", 
  )
}"
}
);


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": {
    "deleteFeatureFlag": true
  }
}

Input Parameters

Provide the name of the feature flag whose overrides you want to reset. The value must match a flag name from the FeatureFlag enum. After the reset, all cluster-, organization-, and user-level overrides for that flag are cleared and the flag reverts to its compiled default value.

Table: Input Parameters and Datatypes

Parameter Type Required Default Description
This table contains all input parameters for this mutation.
feature string yes ย  The name of the feature flag whose cluster, organization, and user-level overrides you want to reset. After the reset, the feature flag reverts to its default value.

The following table lists all available feature flags: