We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
processImport : https://github.com/ardatan/graphql-tools/blob/master/packages/import/src/index.ts#L69
processImport
This function:
This results in unnecessarily bad performance as seen in this attached image:
However, this can simply be boiled down to:
Which results in a reduction of processing time:
Code illustration:
export function processImport( filePath: string, cwd = cwdFactory(), predefinedImports: Record<string, string> = {}, visitedFiles: VisitedFilesMap = new Map(), ): DocumentNode { const set = visitFile(filePath, join(cwd + '/root.graphql'), visitedFiles, predefinedImports); const document = { kind: Kind.DOCUMENT, definitions: [], }; for (const defs of set.values()) { for (const def of defs) { document.definitions.push(def); } } return document; }
As far as I can tell this is functionally the same without adding the overhead of printing and then re-parsing every definition.
The text was updated successfully, but these errors were encountered:
PRs are welcome!
Sorry, something went wrong.
No branches or pull requests
processImport
: https://github.com/ardatan/graphql-tools/blob/master/packages/import/src/index.ts#L69This function:
This results in unnecessarily bad performance as seen in this attached image:
However, this can simply be boiled down to:
Which results in a reduction of processing time:
Code illustration:
As far as I can tell this is functionally the same without adding the overhead of printing and then re-parsing every definition.
The text was updated successfully, but these errors were encountered: