Skip to content

Commit

Permalink
Merge pull request #102 from cloudgraphdev/feature/CG-1276-dgraph-mig…
Browse files Browse the repository at this point in the history
…ration

feat(cli): convert ASTNode to string since now providers return raw s…
  • Loading branch information
tyler-dunkel authored Dec 8, 2022
2 parents 37f0c22 + 1f02b6c commit dde1e12
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"bugs": "https://github.com/cloudgraphdev/cli/issues",
"dependencies": {
"@cloudgraph/sdk": "^0.21.1",
"@cloudgraph/sdk": "^0.22.0",
"@graphql-tools/load-files": "^6.3.2",
"@graphql-tools/merge": "^8.2.0",
"@oclif/core": "1.6.1",
Expand Down
17 changes: 14 additions & 3 deletions src/commands/scan.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import chalk from 'chalk'
import fs from 'fs'
import path from 'path'
import { Opts, pluginMap, PluginType, ProviderData, StorageEngine } from '@cloudgraph/sdk'
import {
Opts,
pluginMap,
PluginType,
ProviderData,
StorageEngine,
} from '@cloudgraph/sdk'
import { range } from 'lodash'
import { print } from 'graphql'

import Command from './base'
import { fileUtils } from '../utils'
Expand Down Expand Up @@ -217,7 +224,11 @@ export default class Scan extends Command {
provider
)}`
)
const providerSchema: string = providerClient.getSchema()

const rawSchema = providerClient.getSchema()
const providerSchema: string =
typeof rawSchema === 'object' ? print(rawSchema) : rawSchema

if (!providerSchema) {
this.logger.warn(`No schema found for ${provider}, moving on`)
continue // eslint-disable-line no-continue
Expand Down Expand Up @@ -305,7 +316,7 @@ export default class Scan extends Command {
isRunning: storageRunning,
engine: storageEngine,
},
providerData: allProviderData
providerData: allProviderData,
})
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,10 @@
resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

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

0 comments on commit dde1e12

Please sign in to comment.