Skip to content

Commit 2f2c7a6

Browse files
fix: update diffbot knowledge graph url from deprecated one (#27)
1 parent 3c4f0d1 commit 2f2c7a6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/diffbot.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ class Diffbot {
431431
else if (options.jsonmode && options.jsonmode != 'extended')
432432
throw new Error('invalid jsonmode');
433433

434-
let diffbot_url = `https://kg.diffbot.com/kg/dql_endpoint?token=${this.token}&query=${encodeURIComponent(options.query)}`;
434+
let diffbot_url = `https://kg.diffbot.com/kg/v3/dql?token=${this.token}&query=${encodeURIComponent(options.query)}`;
435435

436436
if (options.type)
437437
diffbot_url += `&type=${options.type}`;

test/knowledge-graph.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('Knowledge Graph Tests', function() {
1414

1515
let request = await diffbot.knowledgeGraph({ query, type, size, from, jsonmode, nonCanonicalFacts, noDedupArticles });
1616

17-
expect(request.url).to.equal(`https://kg.diffbot.com/kg/dql_endpoint?token=${diffbot.token}&query=${encodeURIComponent(query)}&type=${type}&size=${size}&from=${from}&jsonmode=${jsonmode}&nonCanonicalFacts=${+nonCanonicalFacts}&noDedupArticles=${+noDedupArticles}`);
17+
expect(request.url).to.equal(`https://kg.diffbot.com/kg/v3/dql?token=${diffbot.token}&query=${encodeURIComponent(query)}&type=${type}&size=${size}&from=${from}&jsonmode=${jsonmode}&nonCanonicalFacts=${+nonCanonicalFacts}&noDedupArticles=${+noDedupArticles}`);
1818
expect(request.method).to.equal('GET');
1919
expect(request.body).to.be.undefined;
2020
expect(request.headers).to.be.an('object').that.is.empty;

0 commit comments

Comments
 (0)