Skip to content

Commit

Permalink
feat(cli): handle provider schema type
Browse files Browse the repository at this point in the history
  • Loading branch information
m-pizarro committed Oct 4, 2022
1 parent 55e6468 commit 074b03e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/commands/scan.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
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'

Expand Down Expand Up @@ -218,7 +224,11 @@ export default class Scan extends Command {
provider
)}`
)
const providerSchema: string = print(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 @@ -306,7 +316,7 @@ export default class Scan extends Command {
isRunning: storageRunning,
engine: storageEngine,
},
providerData: allProviderData
providerData: allProviderData,
})
}

Expand Down

0 comments on commit 074b03e

Please sign in to comment.