Skip to content

Commit

Permalink
async tsimport > sync tsimport
Browse files Browse the repository at this point in the history
  • Loading branch information
mishushakov committed Jun 2, 2023
1 parent b7aa1c3 commit c2225fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { importTSmodule } from '@mishushakov/ts-load'
import { importTSmoduleSync } from '@mishushakov/ts-load'
import { resolve } from 'path'
import serialize from 'babel-literal-to-ast'
import { createGeneratedSchema, createScalarsEnumsHash } from './utils'
Expand All @@ -12,11 +12,11 @@ export default function GarphGQtyPlugin(_, { clientConfig }) {
path.node.specifiers = []
}
},
async CallExpression(path, state) {
CallExpression(path, state) {
if (state.file.opts.filename !== resolve(clientConfig)) return
if (path.node.callee.name !== 'createClient') return

const module = await importTSmodule(state.file.opts.filename)
const module = importTSmoduleSync(state.file.opts.filename)
const schema = module.compiledSchema
const generatedSchema = createGeneratedSchema(schema)
const scalarsEnumsHash = createScalarsEnumsHash(schema)
Expand Down

0 comments on commit c2225fd

Please sign in to comment.