Skip to content

Commit

Permalink
fix: typings
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Sep 12, 2018
1 parent 9ab6ea9 commit 01a4637
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ export function importSchema(
flatten(typeDefinitions),
),
}

// Return the schema as string
return print(document)
}
Expand Down Expand Up @@ -240,10 +239,7 @@ function collectDefinitions(
// Process each file (recursively)
rawModules.forEach(m => {
// If it was not yet processed (in case of circular dependencies)
const moduleFilePath =
isFile(filePath) && isFile(m.from)
? path.resolve(path.join(dirname, m.from))
: m.from
const moduleFilePath = resolveModuleFilePath(filePath, m.from)

const processedFile = processedFiles.get(key)
if (!processedFile || !processedFile.find(rModule => isEqual(rModule, m))) {
Expand Down Expand Up @@ -310,10 +306,9 @@ function filterImportedDefinitions(

for (const rootType in groupedFieldImports) {
const fields = groupedFieldImports[rootType].map(x => x.split('.')[1])
const rootDefinition = filteredDefinitions.find(
;(filteredDefinitions.find(
def => def.name.value === rootType,
) as ObjectTypeDefinitionNode
;(rootDefinition as any).fields = (filteredDefinitions.find(
) as any).fields = (filteredDefinitions.find(
def => def.name.value === rootType,
) as ObjectTypeDefinitionNode).fields.filter(
f => includes(fields, f.name.value) || includes(fields, '*'),
Expand Down

0 comments on commit 01a4637

Please sign in to comment.