Skip to content

Commit dde1e12

Browse files
authored
Merge pull request #102 from cloudgraphdev/feature/CG-1276-dgraph-migration
feat(cli): convert ASTNode to string since now providers return raw s…
2 parents 37f0c22 + 1f02b6c commit dde1e12

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"bugs": "https://github.com/cloudgraphdev/cli/issues",
1717
"dependencies": {
18-
"@cloudgraph/sdk": "^0.21.1",
18+
"@cloudgraph/sdk": "^0.22.0",
1919
"@graphql-tools/load-files": "^6.3.2",
2020
"@graphql-tools/merge": "^8.2.0",
2121
"@oclif/core": "1.6.1",

src/commands/scan.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
import chalk from 'chalk'
22
import fs from 'fs'
33
import path from 'path'
4-
import { Opts, pluginMap, PluginType, ProviderData, StorageEngine } from '@cloudgraph/sdk'
4+
import {
5+
Opts,
6+
pluginMap,
7+
PluginType,
8+
ProviderData,
9+
StorageEngine,
10+
} from '@cloudgraph/sdk'
511
import { range } from 'lodash'
12+
import { print } from 'graphql'
613

714
import Command from './base'
815
import { fileUtils } from '../utils'
@@ -217,7 +224,11 @@ export default class Scan extends Command {
217224
provider
218225
)}`
219226
)
220-
const providerSchema: string = providerClient.getSchema()
227+
228+
const rawSchema = providerClient.getSchema()
229+
const providerSchema: string =
230+
typeof rawSchema === 'object' ? print(rawSchema) : rawSchema
231+
221232
if (!providerSchema) {
222233
this.logger.warn(`No schema found for ${provider}, moving on`)
223234
continue // eslint-disable-line no-continue
@@ -305,7 +316,7 @@ export default class Scan extends Command {
305316
isRunning: storageRunning,
306317
engine: storageEngine,
307318
},
308-
providerData: allProviderData
319+
providerData: allProviderData,
309320
})
310321
}
311322

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,10 @@
379379
resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz"
380380
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
381381

382-
"@cloudgraph/sdk@^0.21.1":
383-
version "0.21.1"
384-
resolved "https://registry.yarnpkg.com/@cloudgraph/sdk/-/sdk-0.21.1.tgz#bb4c0243d73bbc98c4bd0c7d04379e0fac309b2d"
385-
integrity sha512-CHNIwkcfuNXify4nAp3wFYTW7sRGhzTu1haolQmihx+19mEc7WJuGV9wtZBlCIL+bctm8FoIVWDPShKuLHseWA==
382+
"@cloudgraph/sdk@^0.22.0":
383+
version "0.22.0"
384+
resolved "https://registry.yarnpkg.com/@cloudgraph/sdk/-/sdk-0.22.0.tgz#c2a4e817a70ae9b123e0fcd401d55f79e24386ab"
385+
integrity sha512-EJ7vLgrMRh52tOH14TKHgOI62BYy9ZH4WuEhcVr8S8RDnLxBO1XsXOKKjIsE+SmawMBzck8qxiEKttppalhJ8g==
386386
dependencies:
387387
"@graphql-tools/load-files" "^6.5.3"
388388
"@graphql-tools/merge" "^8.2.1"

0 commit comments

Comments
 (0)